Which image sizes and formats are supported?
Which image formats are supported?
For the input and result images, the Image Editing API supports three formats: PNG, JPEG and WEBP.
By default, the result image will be in PNG format.
To configure the format of the result image, set the argument export.format with one of the following values:
pngfor PNG format (bigger file size, transparency is saved)jpegorjpgfor JPEG format (smaller file size, transparency is not saved)webpfor WebP format (smaller file size, transparency is saved)
JPEG format does not support transparency.
Asking the Image Editing API to export in JPEG while also setting a background color with transparency will result in an error.
If you want to give it a try, here's the code to export an image in JPEG format:
curl 'https://image-api.photoroom.com/v2/edit?background.color=FFFFFF&outputSize=1000x1000&padding=0.1&export.format=jpeg&imageUrl=URL_OF_YOUR_IMAGE' \
--header 'x-api-key: YOUR_API_KEY' \
--output result.jpegAnd here's the code to export an image in WebP format:
curl 'https://image-api.photoroom.com/v2/edit?background.color=FFFFFF&outputSize=1000x1000&padding=0.1&export.format=webp&imageUrl=URL_OF_YOUR_IMAGE' \
--header 'x-api-key: YOUR_API_KEY' \
--output result.jpegWhat are the max resolution and size of the image?
We recommend limiting images to 25 megapixels for optimal performance.
Maximum File Size: 30MB
Maximum Resolution: 5,000 pixels on the widest side
Last updated
Was this helpful?