Remove an image's background
remove_backgroundCut the subject out of a photo. The background becomes transparent (PNG or WebP), a solid colour if background is a hex colour like #ffffff, or the original scene blurred if it is blur. Set refine for hair, fur and other fine edges, or graphic for a logo or text on a surface. Returns a download URL valid for one hour.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Default png. jpeg needs a background. | |
| refine | No | Sharpen the cut-out's edges against the photo. Default false. | |
| shadow | No | Add a soft drop shadow under the subject (product photos). Default false. | |
| graphic | No | The picture is a logo or text on a surface: also cuts out the gaps inside and between letters. Not for photos. Default false. | |
| image_url | No | Public http(s) address of the image. Use this or image_base64. | |
| background | No | "transparent" (default), "blur", or a colour such as "#ffffff". | |
| image_base64 | No | The image file's bytes, base64-encoded. Use for a local file, e.g. one in the repository. |