> 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

Remove the background from a product, person, or object.

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="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2FebMC2ngiaCq0z79yk4VO%2Fpexels-mizunokozuki-12912150.jpg?alt=media&amp;token=d3b6ded1-408d-4638-84e1-641829cc9d0d" alt=""><figcaption></figcaption></figure>

First with default model:

<figure><img src="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2FGeShGL9onWe1WhDCVOtX%2Fpexels-mizunokozuki-12912150-background_removed%20(1).png?alt=media&amp;token=ce920cc2-67ef-4b15-9466-31e95e03d5c2" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2FwIi3ToYN59EUNkp0103l%2Fpexels-mizunokozuki-12912150-background_removed.png?alt=media&amp;token=3184a9fe-42af-4445-bcf2-7a5e776b8544" 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).
