remove_image_background
Remove the background from an image
Cut the subject (person, product, animal, object) out of a photo and return it on a transparent background as png (default), webp or avif. Optional q (1-100) for webp/avif. Runs a segmentation model (U2Net) on CPU: expect a few seconds per image, not milliseconds. Not available in pipeline.
Responses:
200: Processed image binary (Success Response) Content-Type: application/json Content-Type: image/jpeg
Example Response:
"string"Content-Type: image/png
Example Response:
"string"Content-Type: image/webp
Example Response:
"string"Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | No | Quality (1-100) for webp and avif. Ignored for png, which is lossless. Omit to use the encoder default. | |
| format | No | Output format: png (default), webp or avif. All three keep the transparency; jpeg is not offered because it has none. | png |
| source | Yes | Image source: a public URL (https://...) or a base64-encoded string (optionally as a data URI like data:image/png;base64,...). | |
| delivery | No |