# AI Background Remover – Transparent PNG, Product Photos (`gazidev/background-remover`) Actor

Remove image backgrounds in bulk with AI (IS-Net): transparent PNG/WebP cutouts, white or custom colour backgrounds for product photos, masks and auto-crop to subject. Bulk URLs or datasets, no GPU or subscription. $0.005 per image.

- **URL**: https://apify.com/gazidev/background-remover.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (community)
- **Categories:** AI, E-commerce, For creators
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 background removeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## AI Background Remover – Transparent PNG & Product Photos in Bulk

Remove the background from **hundreds of images at once** with an AI segmentation model (IS-Net). Give it image URLs, a CSV or a dataset from any scraper. You get transparent PNG/WebP cut-outs, or product photos on white or any colour, plus masks and auto-crop. Every result has a direct download link.

- **E-commerce ready:** white background for Amazon, eBay, Etsy and Shopify product images, or keep it transparent.
- **Soft or crisp edges:** natural edges for hair and fur, or a hard threshold for products, logos and objects. Optional feathering.
- **Auto-crop to subject** with a margin, or **mask only** output for your own compositing.
- **Bulk & automation:** lists, Google Sheets/CSV, `datasetId` from another Actor, API, schedules, webhooks, Make/Zapier/n8n.
- **Pay per image, no GPU, no subscription.** Failed images are free.

### Pricing

**$0.005 per image** (`background-removed`). Errors, invalid URLs and skipped images are free. The run stops cleanly at your *maximum cost per run*.

### Input example

```json
{
  "imageUrls": ["https://example.com/product.jpg"],
  "background": "white",
  "outputFormat": "jpg",
  "cropToSubject": true,
  "cropMargin": 40,
  "edgeThreshold": 128
}
```

| Field | Default | Notes |
|---|---|---|
| `background` | `transparent` | `transparent`, `white`, `black`, `color` (with `backgroundColor`) |
| `outputFormat` | `png` | `png` / `webp` keep transparency, `jpg` uses a solid background |
| `cropToSubject`, `cropMargin` | off, 0 | Trim the empty space around the subject |
| `outputMaskOnly` | off | Black/white alpha mask |
| `edgeThreshold` | 0 | 0 = soft AI edges, ~128 = crisp edges |
| `featherPx` | 0 | Blur the edge for a softer cut |
| `maxInputMegapixels` | 25 | Bigger inputs are skipped for free |

### Output

```json
{
  "url": "https://example.com/product.jpg",
  "status": "ok",
  "outputUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/nobg-0001-product-1a2b3c.png",
  "inputWidth": 1200, "inputHeight": 1200, "outputWidth": 980, "outputHeight": 1104,
  "format": "png", "background": "transparent",
  "subjectCoveragePercent": 41.7, "outputBytes": 845123, "processingSeconds": 4.2
}
```

`subjectCoveragePercent` is the share of the image detected as foreground. If it is below 0.5%, the row gets a `warning`; landscapes or scenes without a clear subject can't be cut out. Error rows are free: `HTTP_404`, `TIMEOUT`, `TOO_LARGE`, `INPUT_TOO_LARGE`, `NOT_AN_IMAGE`, `DECODE_ERROR`.

### Use cases

- Product photos on white or transparent backgrounds for marketplaces and stores
- Profile pictures, team photos and ID-style photos on a solid colour
- Stickers, print-on-demand designs, thumbnails, ads and social posts
- Car, furniture and real estate listings
- Catalogue pipelines: scrape product images, then cut them out here

### Notes

- The model works best on images with a clear main subject (people, products, animals, objects). Very fine detail (individual hairs, glass) may be softened.
- Only process images you have the right to use.

### Credits

Segmentation model: IS-Net / DIS "general use" (Apache-2.0), ONNX build distributed with rembg (MIT), run with ONNX Runtime. Not affiliated with the model authors.

### Related Actors by gazidev

AI Image Upscaler · Bulk Image Converter & Compressor · Image Downloader · Image Metadata & EXIF Extractor

# Actor input Schema

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

Direct links to JPEG, PNG, WebP, HEIC/HEIF, AVIF, TIFF, GIF (first frame) or BMP files. Duplicates are removed; invalid values and failed downloads are reported for free.

## `bulkText` (type: `string`):

One URL per line, or a CSV with a `url` / `image` column.

## `sourceFileUrl` (type: `string`):

Public .txt or .csv link (Google Sheets 'Publish to web → CSV' works).

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

Chain after a product scraper or our Image Downloader.

## `datasetField` (type: `string`):

Arrays of URLs are accepted too.

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

JPG output can't be transparent: it uses white unless you pick a colour.

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

Hex colour, used when Background = Custom colour.

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

PNG and WebP keep transparency.

## `quality` (type: `integer`):

Ignored for PNG.

## `cropToSubject` (type: `boolean`):

Trims empty space around the cut-out subject.

## `cropMargin` (type: `integer`):

Space kept around the subject when cropping.

## `outputMaskOnly` (type: `boolean`):

Black-and-white alpha mask (white = subject) instead of the cut-out, for your own compositing.

## `edgeThreshold` (type: `integer`):

0 = soft AI edges (best for hair and fur). 128 = crisp edges for products and logos.

## `featherPx` (type: `number`):

Softens the cut-out edge.

## `maxInputMegapixels` (type: `number`):

Larger images are skipped for free.

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

0 = no limit.

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

Downloads above this size are skipped for free.

## `proxyConfiguration` (type: `object`):

Only needed if an image host blocks datacenter IPs.

## Actor input object example

```json
{
  "imageUrls": [
    "https://raw.githubusercontent.com/xinntao/Real-ESRGAN/master/inputs/children-alpha.png",
    "https://raw.githubusercontent.com/xinntao/Real-ESRGAN/master/inputs/wolf_gray.jpg"
  ],
  "datasetField": "url",
  "background": "transparent",
  "backgroundColor": "#ffffff",
  "outputFormat": "png",
  "quality": 90,
  "cropToSubject": false,
  "cropMargin": 0,
  "outputMaskOnly": false,
  "edgeThreshold": 0,
  "featherPx": 0,
  "maxInputMegapixels": 25,
  "maxImages": 0,
  "maxFileSizeMb": 30
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

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

No description

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

No description

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

No description

# 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://raw.githubusercontent.com/xinntao/Real-ESRGAN/master/inputs/children-alpha.png",
        "https://raw.githubusercontent.com/xinntao/Real-ESRGAN/master/inputs/wolf_gray.jpg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/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://raw.githubusercontent.com/xinntao/Real-ESRGAN/master/inputs/children-alpha.png",
        "https://raw.githubusercontent.com/xinntao/Real-ESRGAN/master/inputs/wolf_gray.jpg",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("gazidev/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://raw.githubusercontent.com/xinntao/Real-ESRGAN/master/inputs/children-alpha.png",
    "https://raw.githubusercontent.com/xinntao/Real-ESRGAN/master/inputs/wolf_gray.jpg"
  ]
}' |
apify call gazidev/background-remover --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gazidev/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/gilAr32zjrKEJ76pi/builds/lIs2S5FAbRI4eZULa/openapi.json
