Which image sizes and formats are supported?

Which image formats are supported?

For the input image, the Remove Background API supports four formats: PNG, JPEG, WEBP and HEIC.

For the result image, the Remove Background 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 format with one of the following values:

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

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

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

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

curl --request POST \
  --url https://sdk.photoroom.com/v1/segment \
  --header 'x-api-key: YOUR_API_KEY' \
  --form image_file=@/absolute/path/to/image.jpg \
  --form format=jpg \
  --output photoroom-result.jpg

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

curl --request POST \
  --url https://sdk.photoroom.com/v1/segment \
  --header 'x-api-key: YOUR_API_KEY' \
  --form image_file=@/absolute/path/to/image.jpg \
  --form format=webp \
  --output photoroom-result.webp

What is the max resolution of the image?

We recommend limiting images to 25 megapixels for optimal performance.

  • Maximum Resolution: 6,000 pixels on the widest side

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?