Remove an image background
image_background_removeRemove backgrounds from images and make them transparent. Use color keying for flat-border product shots or machine learning for arbitrary backgrounds.
Instructions
Make the background transparent. method='color' keys out a flat border colour (instant, offline, best for product/logo shots); method='ml' uses a U^2-Net model for arbitrary backgrounds; method='auto' picks ML when the model is installed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | http(s) URL to fetch. | |
| path | No | Path to the image. | |
| model | No | ML model name: u2net, u2netp, isnet-general-use, silueta. | u2net |
| method | No | auto, color or ml. | auto |
| feather | No | Soften the resulting alpha edge by this many pixels. | |
| softness | No | Width of the soft alpha ramp at the edges. | |
| tolerance | No | Colour distance treated as background (color method). | |
| background | No | Composite onto this RGB colour instead of leaving transparency. | |
| base64_data | No | Inline base64 image. | |
| output_name | No | Override the output filename. | |
| return_image | No | Embed the result inline. | |
| output_format | No | Output codec; must support alpha (png, webp, avif, tiff). | png |
| return_base64 | No | Include base64 in the JSON result. | |
| edge_connected | No | Only remove background regions touching the border, protecting interior matches. | |
| strip_metadata | No | Strip metadata from the output. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| input | No | Summary of the source image, when one was read. | |
| notes | No | ||
| steps | No | ||
| metrics | No | Operation-specific measurements (e.g. comparison scores). | |
| outputs | No | ||
| operation | Yes | Tool that produced this result. | |
| sizeChange | No | ||
| inlineImageIncluded | No | True when an image block accompanies this result for vision-capable clients. |