# Remove background div strong 🔨 In Development — This section is still being developed and may change. Automatically remove an image’s background to create transparency or a custom color backdrop using Freddy vision models. #### Authentication - `Authorization: Bearer $FREDDY_API_KEY` [Get your API key](https://freddy-hub.aitronos.com/freddy/api) ## Request body **`image_url`** string required Public URL or base64-encoded string for the source image. **`background_color`** string optional Hex or named color to fill the background. Transparent by default. **`format`** string optional Return format. Choose `png`, `jpeg`, or `webp`. Default is `png`. ## Returns JSON object containing image data and mask information. ```json { "data": [ { "url": "https://api.freddy.aitronos.com/processed-images/img_abc123.png", "foreground_mask": "https://api.freddy.aitronos.com/masks/mask_abc123.png", "background_removed": true } ] } ``` Request (curl) ```bash curl -X POST "https://api.freddy.aitronos.com/v1/images/remove-background" \ -H "Authorization: Bearer $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "image_url": "https://example.com/product.jpg", "background_color": "white", "format": "png" }' ``` Error Response ```json { "error": { "type": "invalid_image", "message": "Image URL must point to a supported format" } } ``` ## Related resources - [Image object](/docs/api-reference/images/objects/image-object) - [Generate image](/docs/api-reference/images/generate) - [Upscale image](/docs/api-reference/images/upscale) - [Replace background](/docs/api-reference/images/replace-background)