API Reference

Remove background from image

Remove the background from an image. Returns a mask of the foreground object.

Model:remove-background
Credit:2
post/v1/images/remove-background

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

Parameters

NameTypeStatusDescription
input_image
fileRequiredImage file or URL to remove the background from.

Responses

Background removed successfullyRemoveBackgroundResponse

FieldTypeDescription
dataobject[]
urlstringURL to download the result image (RGBA with transparent background)
boxnumber[]Bounding box [x1, y1, x2, y2] of foreground object
curl -X POST "https://api.snapapi.ai/v1/images/remove-background" \
  -H "api-key: YOUR_API_KEY" \
  -F "input_image=@./image.jpg"
Response
{
  "data": [
    {
      "url": "https://outputs.snapapi.ai/outputs/abc123.png",
      "box": [
        10,
        20,
        300,
        400
      ]
    }
  ]
}

Examples (3 examples)

Input

Input 1

Output

Output