remove_background
Remove a specified background color from an image, making it transparent. Outputs a PNG with alpha channel. Specify color and tolerance for precision.
Instructions
Remove a background color from an image and make it transparent. Outputs a PNG with alpha channel. The image must already exist in /root/Pictures/pixel-surgeon (use save_image to import first).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filename": "<filename>"
},
"name": "remove_background"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | Filename of the source image in /root/Pictures/pixel-surgeon | |
| color | No | Target background color as hex (e.g. "#FFFFFF" for white, "#000000" for black, "#FF0000" for red). Default: white. | #FFFFFF |
| threshold | No | How far from the target color a pixel can be and still count as background (0 = exact match only, 30 = default, higher = more aggressive) |