# Background remover

> Cut out a portrait in the browser, or clear a solid backdrop without a download.

Free background remover. A portrait uses MODNet, an Apache-2.0 matting model that downloads once and runs in this browser, with a progress line while it loads. A solid backdrop can be cleared instantly by sampling the corners. RMBG-1.4 is not used because its license is non-commercial. The picture is not uploaded.

- Page: https://benchline.fabwaseem.com/t/background-remover
- Runs: in the browser. Input stays on the device.
- Price: free, no account
- Input: An image, a portrait or solid-color mode, and an optional backdrop color.
- Output: A PNG with the background removed.
- Keywords: remove background, background remover, remove bg
- Updated: 2026-10-18
- Built by: Waseem Anjum (https://fabwaseem.com)

## How to use it

1. **Drop the image.** Add a portrait or a product shot on a plain backdrop.
2. **Pick portrait or solid color.** Portrait downloads the model and shows progress. Solid color clears the border immediately.
3. **Download the PNG.** The result keeps transparency so you can place it on another background.

## Use it from an AI agent

MCP tool name: `remove_background`
MCP endpoint: https://benchline.fabwaseem.com/mcp (Streamable HTTP, no key)
HTTP: POST https://benchline.fabwaseem.com/api/v1/tools/background-remover with the input as the JSON body
This call fetches a public URL on the server. Private addresses are refused.

Remove a solid or near-solid background by flood-filling from the border. color is an optional #rrggbb. The portrait model runs in the browser, not in this handler: MODNet is Apache-2.0, RMBG-1.4 is non-commercial, and the ONNX runtime is too large for the serverless function. Send base64 or a public URL. Private addresses are refused and the decoded file is capped at 10 MB. Returns a PNG as base64.

### Input schema

```json
{
  "type": "object",
  "properties": {
    "file": {
      "type": "object",
      "properties": {
        "url": {
          "description": "Public http or https URL. Private and local addresses are refused.",
          "type": "string"
        },
        "data": {
          "description": "Base64 bytes or a data URI. Decoded size is capped at 10 MB.",
          "type": "string"
        },
        "mimeType": {
          "description": "MIME type when you know it.",
          "type": "string"
        },
        "filename": {
          "description": "File name, including the extension when you have one.",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "description": "The image. Provide url or data."
    },
    "tolerance": {
      "default": 42,
      "description": "How far a border pixel may be from the background color, in RGB distance.",
      "type": "number",
      "minimum": 0,
      "maximum": 180
    },
    "feather": {
      "default": true,
      "type": "boolean"
    },
    "color": {
      "description": "Background color as #rgb or #rrggbb. Blank samples the corners.",
      "type": "string"
    }
  },
  "required": [
    "file",
    "tolerance",
    "feather"
  ],
  "additionalProperties": false
}
```

### Example tools/call

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "remove_background",
    "arguments": {
      "file": {
        "url": "https://example.com/file"
      },
      "tolerance": 42,
      "feather": true
    }
  }
}
```

Setup for Claude, Cursor, and VS Code: https://benchline.fabwaseem.com/mcp/guide

## Questions

### Is the image uploaded?

No. Both the portrait model and the solid-color cutout run in this browser.

### Which model is this?

Portraits use MODNet, licensed Apache-2.0. It is trained on people, so objects and products are a weaker fit. RMBG-1.4 was skipped because that license is non-commercial. The AGPL background-removal package is not bundled.

### What does solid color do?

It samples the corners, then clears pixels of that color that touch the border. A white logo inside the subject stays. Set the color yourself when the corners are not the backdrop.

### Why is the first portrait slow?

The quantized model is about 7 MB and downloads on first use. The progress line tracks that download. Later runs reuse it.

## Related tools

- [Image cropper](https://benchline.fabwaseem.com/t/image-crop): Crop with a free box or an aspect preset, including a circle.
- [Image format converter](https://benchline.fabwaseem.com/t/image-convert): Convert HEIC, WebP, PNG, JPG, and AVIF in the browser. Nothing is uploaded.
- [EXIF viewer and remover](https://benchline.fabwaseem.com/t/exif-viewer-remover): Read photo metadata, including GPS, and strip all of it or only the location.
- [Image compressor](https://benchline.fabwaseem.com/t/image-compress): Shrink JPEG, PNG, WebP, and AVIF in the browser, with the real before and after size.
