AI Uncrop
Overview
AI Uncrop reconstructs the missing parts of the main subject using only the visible portion.
If the edges of the main subject are clipped, they are seamlessly extended to restore the full form.
To uncrop an image, set the argument uncrop.mode to the value ai.auto and removeBackground to true:
(original image)
(uncropped image)


AI Uncrop works automatically:
there’s no need to specify new dimensions or which edges to uncrop
when no edges are cropped, the main subject will not be modified (i.e. AI Uncrop will be a no-op)
If you want to give it a try, here's the code to reproduce the example above:
curl --request POST \
--url https://image-api.photoroom.com/v2/edit \
--header 'x-api-key: YOUR_API_KEY_HERE' \
--form imageFile=@/path/to/image.png \
--form uncrop.mode=ai.auto \
--form removeBackground=true \
--output result-ai-uncrop.pngWhich resolutions are supported?
By default, AI Uncrop will produce outputs at a resolution of 1K (1024x1024).
Output resolutions of 2K and 4K are available for Enterprise plans:



If you're interested to use 2K or 4K resolution, please contact our team to book a demo.
Additional Parameters
uncrop.seed
If you make several calls to the Image Editing API with the same image, you will notice that it will generate a different uncropped subject every time.
In order to reduce the randomness, you can set a fixed value for the seed that the API's random generator will use. The value of the argument uncrop.seed can be any positive integer.
If you provide a value for uncrop.seed, then the API should produce similar-looking subject uncroppings for the same image.
Last updated
Was this helpful?