> 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.

### Combined background removal (`auto_v2`)

**Combined** runs both `auto` and `v2`, then selectively combines their masks using the original image and nearby contours. It is intended to retain foreground details that one model may miss, including the complete physical package and its printed artwork. It does not need a prompt.

Use `"remove": "auto_v2"` explicitly in API requests. Combined is the default selection for signed-in users in the web app; an existing saved selection is restored.

Both segmentation models run, so processing takes longer than a single-model mode. Results still need review: textured backgrounds can leave extra background, and transparent objects, windows and faint object outlines can be ambiguous. Combined is not guaranteed to outperform `auto` or `v2` on every image.

#### Example: transparent PNG

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

#### Example: white background

```json
{
    "url": "https://deep-image.ai/api-example2.jpg",
    "background": {
        "remove": "auto_v2",
        "color": "#FFFFFF"
    },
    "output_format": "png"
}
```

For a packaged product, keep the full package as the foreground, including pictures printed on it. This mode selects a cutout; it does not redraw the product or generate a replacement scene.

#### Comparing the modes

These examples use the public demo images linked above. Each source was processed separately through the local API with `auto`, `v2` and `auto_v2`, using PNG output and default mask settings. The checkerboard is a display aid for transparency; it is not part of the output PNG. These are examples, not an accuracy benchmark. The results on these two sources are similar across the three modes; they do not demonstrate a universal quality improvement.

![Public demo 1: original, auto, v2 and Combined auto\_v2, from left to right](https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2F4PHS0eussf4TjAtzhSom%2Fauto-v2-demo-1-comparison.jpg?alt=media)

Source: [api-example.png](https://deep-image.ai/api-example.png).

![Public demo 2: original, auto, v2 and Combined auto\_v2, from left to right](https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2FLS1Dcs1vWmy49VeEfKeX%2Fauto-v2-demo-2-comparison.jpg?alt=media)

Source: [api-example2.jpg](https://deep-image.ai/api-example2.jpg).

### 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 the `auto` 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).
