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 here.
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
To go further, you can visit the API Reference to learn about all the available parameters (format, channels, bg_color, size, crop).