API & MCP

Everything a person can do on Background Remover, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

Background Remover

Makes the background of an image transparent by colour: it estimates the background colour from the image border and removes it with an adjustable tolerance, or removes one colour everywhere (chroma key / green screen). Works well for product photos, logos and scans on plain backgrounds; it does NOT understand people or complex scenes, because it uses no AI model.

Inputs of Background Remover
FieldTypeDefaultDescription
file (required)file—Image. JPG, PNG, WebP, AVIF, GIF, TIFF or HEIC, max 50 MB. Best results: the subject on a plain, evenly lit background.
modeselect (auto, color-connected, chroma)"auto"Method
colortext—Background colour. Hex colour, e.g. #ffffff or #00ff00. Required for the two colour methods; ignored by the automatic method.
fuzznumber12Colour tolerance. How different a pixel may be from the background colour and still be removed. Raise it for shadows or JPEG noise; lower it if parts of the subject disappear.
cleanupinteger1Edge clean-up. Removes isolated specks and fills small holes in the mask (morphological open/close). 0 = off.
feathernumber0.5Feather edges. Softens the cut-out edge. 0 = hard edge.

Example request

Red square on white (automatic)

curl -X POST https://backgroundremover.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"file":{"filename":"product.png","contentType":"image/png","contentBase64":"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgAQMAAABJtOi3AAAABlBMVEX/////AADrWueTAAAAEklEQVQI12NgIBb8/09dgjgAAPcnH+GApkH4AAAAAElFTkSuQmCC"},"mode":"auto","fuzz":10,"cleanup":1,"feather":0}'

Every result contains

inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.

MCP (Model Context Protocol)

{
  "mcpServers": {
    "background-remover": { "type": "http", "url": "https://backgroundremover.usefulweb.site/mcp" }
  }
}