AI Relighting
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 either the value:
ai.autofor the lighting to be automatically adjustedai.preserve-hue-and-saturationfor the lighting to be adjusted while keeping color hues and saturations as close as possible to the original imagethis can be useful for product images, where maintaining color accuracy is important
Please note that AI Relight is currently limited to images with a maximum resolution of 3,500x3,500 pixels.
Known issue: we don't recommend using AI Relight along with AI Expand in a same API call.
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:
curl 'https://image-api.photoroom.com/v2/edit?referenceBox=originalImage&maxWidth=2000&maxHeight=2000&removeBackground=false&lighting.mode=ai.auto&imageUrl=URL_OF_YOUR_IMAGE' \
--header 'x-api-key: YOUR_API_KEY' \
--output with-re-lighting.pngAnd here are examples of the output produced by the different values for lighting.mode:
Original
lighting.mode=ai.auto
lighting.mode=ai.preserve-hue-and-saturation















Last updated
Was this helpful?