# Background Remover — Transparent PNG & White Background AI (`tidydata/background-remover`) Actor

Remove the background from images in bulk with AI (BiRefNet): transparent PNG/WebP cutouts or JPG on white, any color or blur. Crop, square or Amazon-ready 2000×2000 main images. Links, uploads, Drive or scraper datasets.

- **URL**: https://apify.com/tidydata/background-remover.md
- **Developed by:** [tidydata](https://apify.com/tidydata) (community)
- **Categories:** AI, E-commerce, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.20 / 1,000 image processeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## ✂️ Background Remover — transparent PNG, white background & Amazon-ready product photos

![Real runs: a curly-haired portrait cut out as a transparent PNG, a dog on a blurred background, a sneaker turned into an Amazon main image and a potted plant on a square with a shadow, by the Background Remover](https://api.apify.com/v2/key-value-stores/UJXqVadHhfb2eqS2e/records/background-remover.png)

**Remove the background from thousands of images, no Photoshop and no remove.bg subscription.** Give it image links, upload images or chain it with any product scraper, and get back for every image a **clean cutout**: transparent **PNG** or **WebP**, or a **JPG on white, any color or a blurred background**. Keep the photo's size, **crop to the subject**, center it on a **square**, or make an **Amazon main image** (2000×2000, pure white, product filling 85 %) in one click.

**$4 per 1,000 images** ($0.004 per image) **+ Apify platform usage** (about $0.012 per image, see Pricing) — no subscription, no API key, no account at any AI service. Failed and skipped images are free.

- ✅ **State-of-the-art AI**: BiRefNet, one of the best open background-removal models (better than U²-Net/rembg on hair, fur and fine details), run at full 1024 px resolution
- ✅ **Clean edges**: the old background's color is removed from hair, fur and soft edges, so a cutout from a green wall has **no green halo** on your white page
- ✅ **Ready-to-use layouts**: same size · crop to the subject (with margin) · subject centered on a square · **Amazon main image** (pure white RGB 255, square, product ≈ 85 % of the frame, JPG)
- ✅ **Any background**: transparent, white, any hex color, or the **original photo blurred** (portrait mode) — plus an optional **soft contact shadow** for products
- ✅ **Product catalogs**: chain it with any e-commerce scraper (Amazon, Shopify, eBay, Etsy, WooCommerce…). The **ASIN / SKU / ID is copied** to each row and used in the file name
- ✅ **All common formats**: JPG, PNG, WebP, AVIF, HEIC from iPhones, GIF (first frame), BMP, TIFF, CMYK JPEGs, rotated photos (EXIF), 16-bit PNGs, photos up to 5000 px. Google Drive, Dropbox and OneDrive links
- ✅ **Optional mask** (black-and-white PNG) for designers, video tools and further editing
- ✅ Works with **n8n, Make, Zapier and AI agents** (MCP): one call, one row per image with a direct link to the finished file

### What can I use it for?

- **E-commerce product photos**: white or transparent backgrounds for Amazon, Shopify, eBay, Etsy, WooCommerce and Google Shopping, in bulk.
- **Amazon main images**: square 2000×2000 JPG on pure white with the product filling ~85 % of the frame, as Amazon's image rules ask.
- **Marketplace and catalog cleanup**: make supplier and dropshipping photos consistent (same background, same margins, same size).
- **Marketing and social media**: cutouts of people, pets and products for banners, thumbnails, stickers and ads.
- **Profile photos and ID-style pictures**: people on a plain white or colored background.
- **AI and design pipelines**: masks and cutouts as input for compositing, generative fill or training data.

### How to use it

1. Add your images in one (or more) of these ways:
   - **Image links**: one link per line.
   - **Upload images** from your computer.
   - **Dataset of another Actor**: pick the dataset of your scraper run, the field with the image link(s) (e.g. `image`, `thumbnailUrl` or `images.0.url`) and the ID field (e.g. `asin` or `sku`).
   - **Key-value store**: the images saved in one of your stores.
2. Choose the **layout** (same size, crop, square or Amazon), the **background** (transparent, white, color or blurred) and the **format** (PNG, WebP or JPG).
3. Click **Start**. Each image becomes one row with an `outputUrl` that opens the finished file. All files are also in the run's **key-value store**; export the rows as JSON, CSV or Excel, or read them from the API.

**Tip:** for Amazon, just pick **Layout → Amazon main image**: background, size, margin and format are set for you.

### Output example

```json
{
  "position": 1,
  "id": "B0C1234XYZ",
  "imageUrl": "https://example.com/products/backpack.jpg",
  "status": "ok",
  "outputUrl": "https://api.apify.com/v2/key-value-stores/abc123/records/0001-B0C1234XYZ.png?signature=…",
  "outputKey": "0001-B0C1234XYZ.png",
  "format": "PNG",
  "width": 1024,
  "height": 1024,
  "inputWidth": 1024,
  "inputHeight": 1024,
  "inputFormat": "JPEG",
  "subjectBox": { "x": 224, "y": 132, "width": 584, "height": 776 },
  "subjectCoveragePercent": 40.4,
  "layout": "original",
  "background": "transparent",
  "fileSizeKb": 641.7,
  "seconds": 25.1,
  "charged": true
}
```

`outputUrl` is a signed link: it opens without an API token (keep it private if your images are). With **Also save the mask**, rows also have `maskUrl`. Rows from a dataset have `id` and `sourceRow` (dataset rows without an image link get a free `failed` row, so every product can be joined back). Failed images have `status: "failed"` and the reason in `error`; nothing is charged for them.

### Pricing

| What | Price |
|---|---|
| One finished image (any layout, background and format, mask included) | **$0.004** |
| 1,000 images | **$4** |
| Apify platform usage (paid to Apify at its normal rates; measured) | about **$0.012 per image** (8 GB × ~25 s) |
| Failed or skipped images | free (only a few seconds of usage) |

**About $16 per 1,000 images in total**, a fraction of what paid background-removal APIs charge, and the event price is less than half of the most-used background-removal Actor's ($0.01 per image, also plus usage). Apify store discounts apply automatically (−10 % Bronze, −15 % Silver, −20 % Gold and above). Your **spending limit** is respected: the Actor checks it **before** each image and skips the rest for free once it is reached. Platform usage counts toward that limit too, so Apify may then stop the run with the status *Aborted*: the finished images are kept.

### Limits and good to know

- The Actor needs **8 GB of memory** (set by default): the AI model is large. 16 GB is about 1.5× faster but uses about 30 % more platform usage per image; to go faster for the same price, start several runs in parallel.
- Speed: about **25 seconds per image** on Apify (about 140 per hour; the next image is downloaded and the previous one saved while the AI works). The default timeout (4 hours) fits about 550 images: for bigger batches raise the **Timeout** in the run options; images that don't fit are skipped for free and the summary says so.
- Photos larger than 5000 px are processed at 5000 px on the long side. Images smaller than 32×32 px, **SVG** files and files over the size limit (30 MB by default) are skipped for free.
- Images with **no clear subject** (a plain wall, a landscape, a texture) fail for free with a clear reason.
- Images on **social and streaming platforms** (Instagram, Facebook, TikTok, YouTube, X, Pinterest…) are not downloaded: their terms forbid it.
- Glass, smoke and very thin see-through objects are the hardest cases for any AI: check them before printing.
- Only use images you have the right to edit.

### FAQ

**Do I need a remove.bg, Photoroom or OpenAI account?** No. The AI runs inside the Actor.

**Which AI model is used?** BiRefNet (general, lite version), an open model (MIT licence) that is among the best at fine details like hair and fur. It runs on the Actor's own CPU: your images are not sent to any other AI service.

**Is the Amazon layout compliant?** It produces a square 2000×2000 JPG with a pure white (RGB 255, 255, 255) background and the product filling about 85 % of the frame, which is what Amazon asks for main images. Amazon also requires the photo itself to be a real photo of the product only (no extra text, logos or props): that part is up to your photo.

**Can I get the same size as the original?** Yes: Layout → Same size as the photo (default). Crop and square layouts use the subject's bounding box plus your margin.

**Transparent JPG?** JPG has no transparency: with JPG the cutout is put on white. Use PNG or WebP for transparency (WebP files are 3-6× smaller).

**What if a site blocks downloads?** Polite retries are built in (it respects "too many requests"). Lower "Parallel downloads" for slow sites.

### Related Actors

- [Bulk Image Downloader & Converter](https://apify.com/tidydata/bulk-image-downloader-converter) — download, resize and convert images in bulk, with a ZIP
- [Image Captioner & Alt Text Generator](https://apify.com/tidydata/image-captioner) — SEO alt text, titles and tags for your cutouts
- [Image Upscaler 2x & 4x](https://apify.com/tidydata/image-upscaler-cpu) — enlarge small product photos before removing the background
- [Merge Datasets & Remove Duplicates](https://apify.com/tidydata/merge-dedupe-datasets) — join the cutout links back to your product data

# Actor input Schema

## `imageUrls` (type: `array`):

One link per line to an image (JPG, PNG, WebP, AVIF, HEIC, GIF, BMP, TIFF). Google Drive, Dropbox and OneDrive share links work too. Product photos, people, pets, cars, food, logos…

## `uploadedImages` (type: `array`):

Upload images from your computer.

## `datasetId` (type: `string`):

Pick the dataset of a scraper (Amazon, Shopify, eBay, Etsy, Instagram…) to cut out the image of every row. Each output row keeps the source row number and the ID you choose below.

## `datasetImageField` (type: `string`):

For example image, thumbnailUrl, images or images.0.url. Leave empty to detect it automatically.

## `datasetIdField` (type: `string`):

Optional: e.g. asin, sku or url. Copied to each output row and used in the file name, so you can join the results back.

## `maxImagesPerRow` (type: `integer`):

1 = only the main image of each product. 0 = all images of the row.

## `keyValueStoreId` (type: `string`):

Process the images saved in one of your key-value stores.

## `keyValueStoreKeys` (type: `array`):

Optional. Empty = every key ending in .jpg, .png, .webp…

## `layout` (type: `string`):

Amazon main image follows Amazon's rules: pure white (RGB 255) background, square, product filling about 85 % of the frame, JPG.

## `background` (type: `string`):

What goes behind the subject. Transparent needs PNG or WebP. Blurred original keeps the photo's own background, softly blurred, like a phone's portrait mode.

## `backgroundColor` (type: `string`):

Hex color used when Background = A color. E.g. #F2F2F2, #000, #FFE4E1.

## `outputFormat` (type: `string`):

PNG keeps transparency and is lossless. WebP keeps transparency and is 3-6× smaller. JPG is the most compatible but has no transparency (the cutout goes on white).

## `outputSize` (type: `integer`):

Longest side of the result (the side of the square for square and Amazon layouts). 0 = keep the photo's resolution (Amazon: 2000).

## `marginPercent` (type: `integer`):

Empty space around the subject on each side, for crop, square and Amazon layouts. Leave empty for the recommended value: 5 % (Amazon: 7.5 %, so the product fills about 85 % of the frame).

## `shadow` (type: `boolean`):

A natural contact shadow, nice for product photos on white or colored backgrounds.

## `cleanEdges` (type: `boolean`):

Removes the old background's color from hair, fur and soft edges (no green or gray halo). Recommended.

## `includeMask` (type: `boolean`):

Saves a black-and-white mask PNG of every image as well (for designers and other tools).

## `jpgQuality` (type: `integer`):

Compression quality for JPG and WebP files (92 = high quality, about 3× smaller than PNG). PNG is always lossless.

## `maxImages` (type: `integer`):

Stops after this many images. You are charged only for finished images.

## `maxFileSizeMb` (type: `integer`):

Bigger files are skipped for free (not downloaded).

## `maxConcurrency` (type: `integer`):

Images downloaded at the same time while the AI works on the previous one. Lower it if a server answers 'too many requests'.

## Actor input object example

```json
{
  "imageUrls": [
    "https://api.apify.com/v2/key-value-stores/zCfleofV9kYG6liyw/records/sample-product.jpg"
  ],
  "maxImagesPerRow": 1,
  "layout": "original",
  "background": "transparent",
  "backgroundColor": "#F2F2F2",
  "outputFormat": "auto",
  "outputSize": 0,
  "shadow": false,
  "cleanEdges": true,
  "includeMask": false,
  "jpgQuality": 92,
  "maxImages": 200,
  "maxFileSizeMb": 30,
  "maxConcurrency": 4
}
```

# Actor output Schema

## `results` (type: `string`):

One row per image: link to the finished cutout (and mask), size, subject box, status and the reason when it failed.

## `files` (type: `string`):

All finished images (PNG/WebP/JPG) and masks in the run's key-value store.

## `summary` (type: `string`):

Images processed, failed and skipped, and seconds per image.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "imageUrls": [
        "https://api.apify.com/v2/key-value-stores/zCfleofV9kYG6liyw/records/sample-product.jpg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tidydata/background-remover").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "imageUrls": ["https://api.apify.com/v2/key-value-stores/zCfleofV9kYG6liyw/records/sample-product.jpg"] }

# Run the Actor and wait for it to finish
run = client.actor("tidydata/background-remover").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "imageUrls": [
    "https://api.apify.com/v2/key-value-stores/zCfleofV9kYG6liyw/records/sample-product.jpg"
  ]
}' |
apify call tidydata/background-remover --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tidydata/background-remover"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/j4j6LJdBdkDhjmexs/builds/98mSjp2myHT0ATgbj/openapi.json
