Remove Background
This API uses advanced AI to automatically detect and isolate the main subject of an image and remove the background.
Overview
The /v2/remove-background endpoint can recognize the subject of an image and eliminate the background, providing the subject as the output. For the interactive OpenAPI reference for this endpoint and related v2 operations, see Photoshop API v2 reference.
curl -i -X POST \
https://image.adobe.io/v2/remove-background \
-H 'Authorization: Bearer $token' \
-H 'Content-Type: application/json' \
-H 'x-api-key: $apiKey' \
-d '{
"image": {
"source": {
"url": "<signed_get_url>"
}
},
"mode": "cutout",
"output": {
"mediaType": "image/png"
}
}'
The response includes jobId and statusUrl. Poll statusUrl, or call GET https://image.adobe.io/v2/status/{jobId} with that jobId, until status is succeeded or failed.
Customized workflow
This customized workflow is for users who'd like to generate remove background results as a Photoshop path instead of a regular mask. You'll need to chain API calls to Remove Background service and Photoshop Service.
You'll need to open the result in the Photoshop Desktop application to see the path in the path panel.
You can download the sample end-to-end bash script and follow the comments to try out this customized workflow.
Sample input and output:
Implementation steps
- Download the make-file.atn file. This file will be used in the Photoshop action API call.
- Make the first API call to Remove Background v2 to generate an intermediate result as RGBA remove background.
- Make the second API call to the Photoshop Action service to use the intermediate result as well as the make-file.atn file to generate a final JPEG format result with the desired Photoshop path embedded.
- Open the final result with the Photoshop Desktop app to check the generated path in the path panel.
Optional parameters
The V2 endpoint supports additional parameters for enhanced output quality:
modecutout returns the subject on a transparent background; mask returns a grayscale mask.trimbackgroundColorcolorDecontaminationFor the latest technical information, see the API reference documentation.
For deprecation timelines and support, see Deprecation Announcement and Remove background in the API reference.