# Remove a solid background

Make a plain, single-colour background transparent, for logos, icons, scans and product shots.

- Endpoint: `POST https://setget.net/v1/tools/image-remove-background` with JSON `{"input": {...}}` (add `"wait": 30` to hold the reply until the job finishes)
- MCP: `run_tool` with `slug` = `image-remove-background`
- Page: https://setget.net/tools/image-remove-background

## Files in, files out

This is a file tool. Its file inputs take file references, not file contents and not web addresses.

- Get a reference by uploading: `curl -T FILE https://setget.net/drop/` prints a line `ref  <id>/f1`. Or `POST https://setget.net/v1/drops` with `{"files":[{"name","size"}]}`, PUT the bytes to the returned `upload.url` with the listed headers, and use the file's `ref`. Over MCP use the `drop` tool. A file under about 700 KB can also be sent in place as a `data:<type>;base64,<content>` URI.
- Uploads are at most 100 MB per file, are readable by anyone with the link, and expire (one hour by default). Programs are refused.
- The tool runs as a job. The reply is `{"tool", "ms", "result", "files", "job"}`: `result` is JSON, and every result file comes back in `files` as `{"name", "size", "content_type", "kind", "url", "ref"}`. Download it from `url`, or pass `ref` as the input of another file tool.
- A job still running when the wait ends answers 202 with `job`. Follow it with `GET https://setget.net/v1/jobs/<id>?wait=30`, or stream progress from `GET https://setget.net/v1/jobs/<id>/events` (over MCP: the `job` tool). A person can watch it at `job.url`.

## Inputs

- `image` (required, file, a file reference such as `DROP_ID/f1`, accepts image): The image with a plain background.
- `color` (optional, string, default `""`): The background colour to remove, as a hex colour or colour name. Leave empty to take it from the corners of the image.
- `tolerance` (optional, integer, default `10`, range 0..100): How close a colour must be to count as background: 0 is an exact match, 100 matches everything.
- `feather` (optional, integer, default `0`, range 0..20): Soften the cut edge over this many pixels. 0 leaves a hard edge.
- `contiguous` (optional, boolean, default `true`): Only remove background connected to the edge of the image, so the same colour inside the subject is kept. Turn off to remove the colour everywhere.
- `format` (optional, string, one of `png`, `webp`, default `"png"`): File format of the result. Both keep transparency.

## Example 1: Remove the colour found in the corners

Upload first. Each placeholder below stands for the reference of one upload: `DROP_ID/f1` = [sample.png](https://setget.net/static/samples/sample.png).

```json
{"input":{"image":"DROP_ID/f1"},"wait":30}
```

## Example 2: Remove white everywhere, with a soft edge

Upload first. Each placeholder below stands for the reference of one upload: `DROP_ID/f1` = [sample.jpg](https://setget.net/static/samples/sample.jpg).

```json
{"input":{"image":"DROP_ID/f1","color":"#ffffff","tolerance":20,"feather":1,"contiguous":false},"wait":30}
```

**Does this work on photos?** Only if the background is one flat colour, such as a white studio backdrop or a green screen. It matches a colour; it does not recognise people or objects. Busy or graduated backgrounds need a dedicated cut-out program.

**Parts of my subject became transparent. Why?** They are close to the background colour and touch the edge of it. Lower the tolerance, and keep contiguous on so matching colours inside the subject survive.

**There is a thin halo around the subject. What helps?** Raise the tolerance a little and set feather to 1 or 2 to soften the edge.

**How is the background colour chosen?** From the four corner pixels: the colour most of them share. Give "color" yourself if the corners are not background.
