SnapeditAPI
Đăng nhậpBắt đầu miễn phí
Đăng nhập
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-graphic
Credit:1
post/v1/images/remove-background-graphic

AuthorizationThis endpoint requires an API key. Pass it in the api-key header on every request. Learn more

Parameters

NameTypeStatusDescription
input_image
fileRequiredGraphic image file or URL to remove the background from.
output_type
stringOptionalChoose foreground to return the foreground RGBA image, or mask to return the foreground mask.
foregroundmask
(default: foreground)

Responses

Graphic background removed successfullyRemoveBackgroundResponse

FieldTypeDescription
dataobject[]
urlstringURL to download the selected result image
boxnumber[]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
      ]
    }
  ]
}

Examples (3 examples)