# AI Background Remover (Bulk, transparent PNG) (`toowl/background-remover`) Actor

Remove image backgrounds in bulk from URLs with the IS-Net AI model: transparent PNG/WebP, white or any colour background for marketplaces, mask only, or cropped to the subject. No third-party API. Pay per image.

- **URL**: https://apify.com/toowl/background-remover.md
- **Developed by:** [Chalid Ade](https://apify.com/toowl) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 background removed

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/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 in bulk

Remove the background from images in bulk with the **IS-Net** AI model (DIS, general use): products, people, animals, cars. Get a **transparent PNG/WebP**, a **white background for marketplaces** (Amazon, Shopee, Tokopedia, eBay), any colour, the **mask** alone, or the subject **cropped** with padding.

The model runs inside the Actor: no remove.bg API, no per-image fee to a third party.

### Features

- **Transparent PNG or WebP**, or JPG on a background colour.
- **Mask only** (white subject on black) for your own compositing.
- **Crop to subject** with padding: consistent product shots.
- **Soft edges** for hair and fur, **hard edges** for products and logos.
- **Max width** to shrink huge photos first.
- **Pay per image.** Failed images are free.

### Input

```json
{
  "files": [
    { "url": "https://example.com/products/shoe-01.jpg" },
    { "url": "https://example.com/products/shoe-02.jpg" }
  ],
  "format": "jpg",
  "background": "#ffffff",
  "cropToSubject": true,
  "padding": 40
}
```

| Field | Default | Notes |
| --- | --- | --- |
| `files` | — | Image URLs (JPG, PNG, WebP, AVIF, TIFF) |
| `output` | `cutout` | `cutout`, `mask` |
| `format` | `png` | `png`, `webp`, `jpg` |
| `background` | transparent | Any CSS colour |
| `cropToSubject` | false | |
| `padding` | 0 | px around the crop |
| `hardEdges` | false | |
| `maxWidth` | — | px |
| `quality` | 90 | WebP/JPG |
| `maxFileSizeMb` | 30 | |

### Output

```json
{
  "url": "https://example.com/products/shoe-01.jpg",
  "name": "shoe-01.jpg",
  "downloadUrl": "https://api.apify.com/v2/key-value-stores/…/records/0001-shoe-01-nobg.jpg",
  "width": 1180,
  "height": 864,
  "subjectPercent": 38.2,
  "sizeAfter": 182044,
  "seconds": 6.1
}
```

### Pricing

Pay per event: one `background-removed` per image. Failed images are free.

### Model and licence

IS-Net general-use (Qin et al., "Highly Accurate Dichotomous Image Segmentation", Apache-2.0), run with ONNX Runtime on the CPU.

### Free browser version

[toowl.my.id/en/remove-background](https://toowl.my.id/en/remove-background/) removes backgrounds in your browser, free, with brush and lasso touch-ups.

### Call it from your code

```bash
curl -X POST "https://api.apify.com/v2/acts/toowl~background-remover/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"files":[{"url":"https://example.com/your-file"}]}'
```

The same call works from Python (`apify-client`), JavaScript, Make, Zapier and n8n (Apify app/node or a plain HTTP request).

### Use it from AI agents (MCP)

Add this Actor as a tool to Claude, Cursor, VS Code or any MCP client through Apify's MCP server:

```
https://mcp.apify.com/?actors=toowl/background-remover
```

The agent can then pass file URLs and read the results itself.

### More toowl file APIs

Speech to text & subtitles, AI vocal remover, text to speech, AI object remover, PDF to Markdown, PDF to Word & Excel, HTML/URL to PDF, OCR, Office to PDF, PDF compressor, PDF merge/split, PDF password protect, PDF to image, image to PDF, bulk watermark, image converter and compressor, background remover, AI upscaler, image to SVG, QR code and barcode generators, QR/barcode reader, favicon generator, video compressor, frame extractor and audio converter. All pay per file, all batch-friendly: [toowl.my.id/en/api](https://toowl.my.id/en/api/).

Questions or a format that fails? Open an issue on the Actor's **Issues** tab.

# Actor input Schema

## `files` (type: `array`):

Direct links to the images (JPG, PNG, WebP, AVIF, TIFF).

## `output` (type: `string`):

The subject with the background removed, or just the black-and-white mask.

## `format` (type: `string`):

PNG and WebP keep transparency. JPG has no transparency, so the background colour below is used.

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

Leave empty for transparent. Any CSS colour, e.g. #ffffff for Amazon/Shopee/Tokopedia-style white. JPG uses white when empty.

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

Trim the empty area around the subject.

## `padding` (type: `integer`):

Space left around the subject when cropping to it.

## `hardEdges` (type: `boolean`):

Crisper outline for products and logos; leave off for hair and fur.

## `maxWidth` (type: `integer`):

Shrink larger images first. Empty = original size.

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

For WebP and JPG.

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

Larger files are skipped with an error (not charged).

## Actor input object example

```json
{
  "files": [
    {
      "url": "https://raw.githubusercontent.com/danielgatis/rembg/main/examples/car-1.jpg"
    }
  ],
  "output": "cutout",
  "format": "png",
  "cropToSubject": false,
  "padding": 0,
  "hardEdges": false,
  "quality": 90,
  "maxFileSizeMb": 30
}
```

# Actor output Schema

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

One row per input file, with a download link for the result where there is one.

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

Result files in the default key-value store, plus a SUMMARY record.

# 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 = {
    "files": [
        {
            "url": "https://raw.githubusercontent.com/danielgatis/rembg/main/examples/car-1.jpg"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("toowl/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 = { "files": [{ "url": "https://raw.githubusercontent.com/danielgatis/rembg/main/examples/car-1.jpg" }] }

# Run the Actor and wait for it to finish
run = client.actor("toowl/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 '{
  "files": [
    {
      "url": "https://raw.githubusercontent.com/danielgatis/rembg/main/examples/car-1.jpg"
    }
  ]
}' |
apify call toowl/background-remover --silent --output-dataset

```

## MCP server setup

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