> For the complete documentation index, see [llms.txt](https://documentation.deep-image.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.deep-image.ai/common-usecases/remove-background.md).

# Remove background

Use background removal when you want a clean cutout for ecommerce, design, or further editing.

The simplest request uses `background.remove`.

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "background": {
        "remove": "auto"
    }
}
```

`auto` works well for most images.

Use `human` for portraits.

Use `item` for products and objects.

### Prompt-based removal

Use prompt-based removal when the image contains multiple foreground elements and you want to control what stays.

```json
{
    "background": {
        "remove": "generative",
        "prompt": "keep relevant foreground, keep relevant objects"
    }
}
```

Let's remove background from this photo:

<figure><img src="/files/o4Phr8PwEsOqnNEJPlzM" alt=""><figcaption></figcaption></figure>

First with default model:

<figure><img src="/files/aYgal4D4TlH6GPeM5wFl" alt=""><figcaption></figcaption></figure>

And then with diffusion based background removal with prompt: "keep relevant foreground, keep relevant objects"

<figure><img src="/files/UizaVNvhqKA42Gc0mfZK" alt=""><figcaption></figcaption></figure>

You can combine removal with a flat color or a replacement background.

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "background": {
        "remove": "item",
        "color": "#FFFFFF"
    }
}
```

For full parameter details, examples, and item cropping, see [Background removal and generation](/image-processing/background-removal-and-generation.md).

For photo preparation tips, see [Remove BG recommendation](/image-processing/background-removal-and-generation/remove-bg-recommendation.md).
