Quickstart Guide

Who is this API for?

The Remove Background API allows you to isolate the subject of an image by removing the background of the image.

Using this API is appropriate if you only need to remove the background of your image, and don't need to perform any additional edits.

The quality of the background removal will be the same than that of the Image Editing API.

However, because this API only performs background removal, its response time will be faster. Data on median and p90 response times is available herearrow-up-right.

circle-info

For additional information about the important features to look for in image background removal technology, you can consult this blog articlearrow-up-right.

How do I make my first API call?

To call the Remove Background API and remove the background of an image, you can run the following code in your terminal:

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

If you don't have an apiKey, here are the steps to create yours.

To go further, you can visit the API Reference to learn about all the available parameters (format, channels, bg_color, size, crop).

Last updated

Was this helpful?