API Reference
Remove background from graphic image
Remove the background from a graphic image. This endpoint is tailored for logos, stickers, anime, cartoons, illustrations, and other non-photographic artwork. By default, returns the foreground as an RGBA image. Set output_type to mask to return the foreground mask instead.
Model:
remove-background-graphicCredit:1
post
/v1/images/remove-background-graphicAuthorization — This endpoint requires an API key. Pass it in the api-key header on every request. Learn more
Parameters
| Name | Type | Status | Description |
|---|---|---|---|
input_image | file | Required | Graphic image file or URL to remove the background from. |
output_type | string | Optional | Choose foreground to return the foreground RGBA image, or mask to return the foreground mask.foregroundmask (default: foreground) |
Responses
Graphic background removed successfullyRemoveBackgroundResponse
| Field | Type | Description |
|---|---|---|
data | object[] | |
url | string | URL to download the selected result image |
box | number[] | Bounding box [x1, y1, x2, y2] of foreground object |
curl -X POST "https://api.snapedit.app/v1/images/remove-background-graphic" \
-H "api-key: YOUR_API_KEY" \
-F "input_image=@./image.jpg" \
-F "output_type=foreground"Response
{
"data": [
{
"url": "https://outputs.snapedit.app/outputs/abc123.png",
"box": [
10,
20,
300,
400
]
}
]
}

