AI Relight

Overview

The Image Editing API allows you to correct lighting issues, such as over-exposition or under-exposition, by re-lighting the input image.

To re-light an image, set the argument lighting.mode to one of these three values:

  • ai.auto for the lighting to be automatically adjusted

  • ai.preserve-hue-and-saturation for the lighting to be adjusted while keeping color hues and saturations as close as possible to the original image

    • this can be useful for product images, where maintaining color accuracy is important

  • ai.optimize-portrait for the lighting to be optimized for human portrait photography. Specifically, this mode acts on the subject by:

    • enhancing light intensity

    • removing blemishes

    • applying subtle teeth whitening

    • preserving freckles and skin characteristics

Examples

Here are some examples of what re-lighting can achieve by setting lighting.mode=ai.auto:

Original

Re-lighted

If you want to give it a try, here's the code to reproduce the examples above:

Try it now!

And here are examples of the output produced by the different values for lighting.mode, for different use-cases:

Second-hand marketplace

Original

lighting.mode=ai.auto

lighting.mode=ai.preserve-hue-and-saturation

School portraits

Original

lighting.mode=ai.auto

lighting.mode=ai.preserve-hue-and-saturation

lighting.mode=ai.optimize-portrait

Food industry

Original

lighting.mode=ai.auto

lighting.mode=ai.preserve-hue-and-saturation

Car industry

Original

lighting.mode=ai.auto

lighting.mode=ai.preserve-hue-and-saturation

Luxury industry

Original

lighting.mode=ai.auto

lighting.mode=ai.preserve-hue-and-saturation

Last updated

Was this helpful?