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
POST https://backgroundremover.usefulweb.site/api/v1/calculate– run Background RemoverGET https://backgroundremover.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
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.
| Field | Type | Default | Description |
|---|---|---|---|
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. |
mode | select (auto, color-connected, chroma) | "auto" | Method |
color | text | — | Background colour. Hex colour, e.g. #ffffff or #00ff00. Required for the two colour methods; ignored by the automatic method. |
fuzz | number | 12 | Colour 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. |
cleanup | integer | 1 | Edge clean-up. Removes isolated specks and fills small holes in the mask (morphological open/close). 0 = off. |
feather | number | 0.5 | Feather 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)
- Streamable HTTP endpoint:
https://backgroundremover.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
background_remover - Local stdio connector:
node src/mcp-stdio.ts --tool=background-remover
{
"mcpServers": {
"background-remover": { "type": "http", "url": "https://backgroundremover.usefulweb.site/mcp" }
}
}