File size, resolution and format

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:

  • png for PNG format (bigger file size, transparency is saved)

  • jpeg or jpg for JPEG format (smaller file size, transparency is not saved)

  • webp for WebP format (smaller file size, transparency is saved)

circle-info

Both JPEG and WebP export with a quality of 90

circle-exclamation

If you want to give it a try, here's the code to export an image in JPEG format:

curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form imageFile=@/path/to/your/image.jpg \
  --form background.color=FFFFFF \
  --form outputSize=1000x1000 \
  --form padding=0.1 \
  --form 'export.format=jpeg' \
  --output result.jpeg

And here's the code to export an image in WebP format:

What 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

Images with a larger resolution are supported (if they stay below 30MB), but will be resized down to 5,000 pixels on the widest side.

circle-info

Please note that large images will result in API calls taking a longer time to complete.

If you experience timeouts, we recommend that you try to increase the default timeout of your networking library.

Last updated

Was this helpful?