Last updated: March 24, 2025

<span aria-hidden="true" id="automatic-background-removal-from-images"></span>

# Automatic background removal from images

![Marius Kleidl](/assets/images/teammates/avatar-acconut-1.jpg?dpl=dpl_7kibEao2BYN7CAhZRsbwkyFkShjF)

**Marius Kleidl**

Software Engineer · Munich, Germany · Show bio

[](https://x.com/Acconut%5F)[](https://github.com/Acconut)

We are excited to announce the addition of a new Robot to our fleet: the[🤖 /image/bgremove](/docs/robots/image-bgremove.md) Robot can automatically detect and remove backgrounds from images using advanced AI technology. This powerful tool allows you to create clean, professional-looking results with transparent backgrounds, saving you time and effort while producing high-quality images.

Automatic background removal is one of the most valuable additions to any digital workflow. E-commerce retailers can create uniform product catalogs with consistent backgrounds, focusing attention on the products themselves. Social networks benefit from clean headshots with standardized backgrounds, creating a cohesive look across team pages. Graphic designers and marketers save significant time by quickly extracting subjects from photographs without tedious manual masking work, which accelerates the creation of digital compositions, social media assets, and marketing materials.

More advanced applications include virtual try-on experiences for clothing and accessories, augmented reality product placement, and virtual room planning for furniture and decor items. By automating this process, Transloadit helps businesses of all sizes achieve professional results without the time-consuming manual editing that is traditionally required.

<span aria-hidden="true" id="using-imagebgremove"></span>

## Using 🤖/image/bgremove

Let's start with an example image. The following shows a portrait photograph with a background that we want to remove:

![Original portrait photograph with background.](/_next/static/immutable/media/input.0qgaluyq1gh87.jpg)

To remove the background using the [🤖 /image/bgremove](/docs/robots/image-bgremove.md) Robot, we can use the following Template:

```json
{
  "steps": {
    ":original": {
      "robot": "/upload/handle"
    },
    "background_removed": {
      "use": ":original",
      "robot": "/image/bgremove",
      "format": "png"
    },
    "export": {
      "use": [":original", "background_removed"],
      "robot": "/s3/store",
      "credentials": "YOUR_AWS_CREDENTIALS",
      "path": "my_target_folder/${unique_prefix}/${file.url_name}"
    }
  }
}

```

In this Template, we first handle the uploaded image with the[🤖 /upload/handle](/docs/robots/upload-handle.md) Robot. Then we pass it through the[🤖 /image/bgremove](/docs/robots/image-bgremove.md) Robot. The only parameter we need to specify is `format`, which is set to `png` by default since we need a format that supports transparency. The Robot will take care of the rest using advanced AI technology.

Finally, both the original image and the processed image with the background removed are passed through the [🤖 /s3/store](/docs/robots/s3-store.md) Robot to store them in an S3 bucket. Of course, you can replace this with any of our other[file exporting](/services/file-exporting.md) Robots, which support Google Cloud Storage, Azure Blob Storage, and Digital Ocean Spaces, among others.

After processing our example image, we can see that the background has been completely removed, leaving only the subject with a transparent background:

![Portrait photograph with background removed, showing transparent background.](/_next/static/immutable/media/output.3c4sf4j5krek9.png)

<span aria-hidden="true" id="combining-with-other-robots"></span>

## Combining with other Robots

The [🤖 /image/bgremove](/docs/robots/image-bgremove.md) Robot, while powerful on its own, really shines when combined with other Robots in your workflow. For example, you might want to resize the image or place it on a different background color after removing the original background.

Here's an example that removes the background, replaces it with a light gray color, and resizes the image to 600x600 pixels:

```json
{
  "steps": {
    ":original": {
      "robot": "/upload/handle"
    },
    "background_removed": {
      "use": ":original",
      "robot": "/image/bgremove",
      "format": "png"
    },
    "resized": {
      "use": "background_removed",
      "robot": "/image/resize",
      "width": 600,
      "height": 600,
      "resize_strategy": "fillcrop",
      "background": "#f0f0f0"
    }
  }
}

```

Here's the result of the above Template:

![Portrait photograph with background replaced with a light gray color and resized to 600x600 pixels.](/_next/static/immutable/media/resized.1j4565cknjnf0.png)

<span aria-hidden="true" id="supported-formats"></span>

## Supported formats

The [🤖 /image/bgremove](/docs/robots/image-bgremove.md) Robot accepts nearly all image formats as input, including but not limited to JPEG, PNG, GIF, TIFF, WebP, BMP, and HEIF. A full list of all formats supported by our AI services can be found in the[image format documentation](/docs/supported-formats/image-formats.md).

The output format is currently limited to PNG, as it's the most common format that supports transparency. If you need the final image in a different format, you can use the[🤖 /image/resize](/docs/robots/image-resize.md) Robot to convert it after removing the background.

<span aria-hidden="true" id="conclusion"></span>

## Conclusion

With the [🤖 /image/bgremove](/docs/robots/image-bgremove.md) Robot, you can automatically remove backgrounds from images with just a few lines of JSON. This powerful tool leverages advanced AI technology to save you time and effort while producing professional-quality results for e-commerce, social media, marketing materials, and more.

For a comprehensive look at everything available to you with this Robot, including information about pricing, check out its[documentation](/docs/robots/image-bgremove.md).

[#assembly](/blog/tags/assembly.md)[#automation](/blog/tags/automation.md)[#image-bgremove-robot](/blog/tags/image-bgremove-robot.md)[#image-resize-robot](/blog/tags/image-resize-robot.md)[#s3-store-robot](/blog/tags/s3-store-robot.md)[#walkthrough](/blog/tags/walkthrough.md)[#image-processing-service](/blog/tags/image-processing-service.md)

### 👩‍💻 Join 20k+ developers

Sign up for our [monthly newsletter](/newsletters.md) to receive direct links to 3 exclusive tech — and 2 product updates. No less, no more.

Your email:

Get access

## File uploading and encoding. Made simple.

Transloadit streamlines file handling for developers, trusted by brands like Coursera and The New York Times. We’re known for a reliable API, top-notch support, and a strong commitment to open source, with projects like [Uppy⁠](https://uppy.io) and [Tus⁠](https://tus.io) setting standards in file processing.

[Sign up](/c/)[Book a Demo](https://survey.typeform.com/to/kRg47Xi5)

No credit card needed

Cancel anytime
