Background Remover for Images (rembg, CPU) avatar

Background Remover for Images (rembg, CPU)

Pricing

from $6.40 / 1,000 image processeds

Go to Apify Store
Background Remover for Images (rembg, CPU)

Background Remover for Images (rembg, CPU)

Remove the background from images in bulk: image URLs in, transparent PNG or WebP out with download links. Optional solid colour background and crop to subject. CPU only, no API key. Direct image files only; softer on hair and fine edges than GPU models.

Pricing

from $6.40 / 1,000 image processeds

Rating

0.0

(0)

Developer

Data Done Right

Data Done Right

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Security

Limited permissions

Share

This background remover takes a list of direct image URLs, removes the background from each image with the open-source rembg library and the U2-Net model, and gives you a download link for every result as a transparent PNG or WebP, optionally on a solid colour and cropped to the subject. It runs on CPU in the cloud: no GPU, no API key, nothing to install.

What it does not do. It reads direct image files (JPEG, PNG, WebP, BMP, GIF, TIFF) from a public URL. It does not open web pages, social media posts, HEIC photos (convert them first), SVG or video. It is not a BiRefNet or GPU-grade matting tool: U2-Net on CPU is softer on hair, fur, glass and fine edges, and it can cut incompletely when a dark subject stands against a bright background (see "Quality and limits" below). There is no alpha matting, no manual brush and no background replacement with another picture, only transparent or one flat colour. Use it on images you own or have the right to edit.

What you get

  • One dataset row per image: your source URL, a signed download link to the cut-out, width and height, file size, the share of the image detected as subject (foregroundPercent), the time it took, and a clear error if it failed.
  • Transparent PNG (lossless) or WebP (smaller), or a flat background colour such as #ffffff, and an optional crop to the subject.
  • Failed, rejected and "no subject found" images are free; one bad link never stops the run.

How to remove the background from an image URL

  1. Paste one or more direct image URLs in imageUrls, for example https://example.com/product.jpg.
  2. Leave the defaults (model u2net, PNG, transparent background) and run.
  3. Open the dataset: the url column links to each cut-out. The files are also in the run's key-value store.

How to put a white background behind product photos

Set "backgroundColor": "#ffffff" (any hex colour works: #f4f4f4, #000) and, for tight shop images, "cropToSubject": true. The result is an opaque image with the subject on that colour. WebP output keeps files small.

How to make a transparent PNG and crop it to the subject

Keep "backgroundColor": "transparent" and set "cropToSubject": true. The empty margin is trimmed to the bounding box of the detected subject. width and height in the row are the size of the final file.

How to remove backgrounds from many images quickly

Switch model to u2netp: about twice as fast, fine for single objects on plain backgrounds, but in our tests it lost the arms on a photo of a person and failed on a silhouette. Raise maxImagesPerRun (default 100, up to 2000). Duplicate URLs are processed once.

Input

FieldDefaultWhat it does
imageUrlsone sample photoDirect image links (strings, or objects with a url). Required.
modelu2netu2net (better on people and thin parts) or u2netp (about 2x faster, simple objects).
outputFormatpngpng (lossless) or webp (quality 90, smaller). Both keep transparency.
backgroundColortransparenttransparent or a hex colour like #ffffff.
cropToSubjectfalseTrim the result to the detected subject.
maxImagesPerRun100Hard cap per run (max 2000). Extra images are listed as skipped, free.
maxImageSizeMb25Larger downloads are rejected (max 100).
maxMegapixels40Larger images are rejected before decoding (max 50).
maxLongSide4096Larger images are downscaled first; the row's note says so.
imageTimeoutSecs120Download plus processing time per image.
outputStoreNameemptyKeep the result files in a named store until you delete it.

Input example:

{
"imageUrls": ["https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg"],
"model": "u2net",
"outputFormat": "png",
"backgroundColor": "transparent",
"cropToSubject": false
}

Output example (from a real local run of this input):

{
"index": 1,
"sourceUrl": "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
"status": "ok",
"url": "https://api.apify.com/v2/key-value-stores/WmCCWvM7evDVmpoin/records/0001-grapefruit-slice-332-332.png",
"key": "0001-grapefruit-slice-332-332.png",
"model": "u2net",
"format": "png",
"background": "transparent",
"width": 332,
"height": 332,
"originalWidth": 332,
"originalHeight": 332,
"bytes": 208881,
"originalBytes": 18122,
"foregroundPercent": 64.4,
"cropped": false,
"processingMs": 1942,
"error": null,
"note": null
}

On Apify the url is a signed link that works without a token. A SUMMARY record counts delivered, failed and skipped images, and a FAILED record lists the reasons.

Quality and limits

Measured locally on a handful of photos with both models (no claim beyond these):

  • Single objects on a distinct background (a fruit slice, a painted hand, a car): both models give a clean cut-out.
  • A person with raised arms: u2net kept both raised arms; u2netp lost most of them and cut the body off at the hips. Use u2net for people.
  • A dark elephant silhouette against a bright sunset: u2netp found almost nothing; u2net found the head and back but dropped part of the lower body. Check such images by eye.
  • Hair, fur, glass, smoke and semi-transparent edges: U2-Net returns a soft mask, edges can look slightly haloed. A GPU model such as BiRefNet is sharper on these.
  • If the model finds almost no subject (under 0.1% of the image), the image is reported as an error and not charged. Use foregroundPercent to spot suspicious results: values near 0 or near 100 deserve a look.
  • Images with their own transparency are flattened onto white before detection (the note says so). Animated GIFs: only the first frame. EXIF rotation is applied.
  • Images over maxLongSide are downscaled, so the result is smaller than the original. Raise maxLongSide (max 8192) if you need full size.
  • Typical speed: about 1 to 3 seconds per image once the run has started, plus 10 to 20 seconds of start-up.

How much does it cost

$0.008 per image delivered (event image-processed, $8 per 1,000). Compute is included. No start fee. Failed, skipped, rejected and "no subject" images are free.

ImagesPrice
1,000$8
10,000$80
100,000$800

Set a maximum cost per run in Apify and the Actor stops cleanly when it is reached ("spending limit reached" in the status and the skipped rows).

Use cases

  1. White-background product photos for a shop or marketplace listing.
  2. Transparent PNG logos, stickers and mock-up assets from existing photos.
  3. Cut-outs of items from a catalogue feed before they go into a design template.
  4. Preparing images for an ML dataset where the subject must be isolated.
  5. Cut-outs of video stills: extract frames with the Video Frame Extractor, then run them through this Actor.

FAQ

Which model does it use and is the licence OK for commercial use? rembg (MIT) with U2-Net or U2-Net-P (Apache-2.0). The weights are baked into the Actor image at build time; nothing is downloaded during a run. We do not use models with non-commercial licences.

Why not BiRefNet or a GPU model? GPU runs cost far more. This Actor is the cheap CPU option; edges are softer, and the README says where it struggles.

Can I pass images from my own storage? Only through a public (or signed) URL; the Actor cannot read private files.

Does it work on HEIC, SVG or web pages? No. HEIC and SVG are rejected, and a link to an HTML page returns an error without charge. Convert HEIC first.

How big can an image be? Up to 25 MB and 40 megapixels by default (100 MB and 50 megapixels at most). Larger pixel counts than 4096 on the long side are downscaled unless you raise maxLongSide.

Does it keep my images? Results are written to the run's key-value store (or the named store you choose) and follow Apify's data retention. The Actor does not send images anywhere else; downloads are limited to public internet addresses.

Use with the Apify API, MCP, n8n or Make

Python:

from apify_client import ApifyClient
client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("<username>/background-remover").call(run_input={
"imageUrls": ["https://example.com/product.jpg"],
"backgroundColor": "#ffffff",
"cropToSubject": True,
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
print(row["status"], row["url"] or row["error"])

JavaScript:

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<APIFY_TOKEN>' });
const run = await client.actor('<username>/background-remover').call({
imageUrls: ['https://example.com/product.jpg'],
outputFormat: 'webp',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((i) => i.url ?? i.error));

The same input works in the Apify MCP server (ask your assistant to "remove the background from this image URL"), in n8n through the Apify node, and in Make through the Apify app (run the Actor, then fetch dataset items).

  • Image Compressor & Resizer: Compress Images in Bulk: shrink the cut-outs afterwards.
  • HEIC to JPG Converter: Convert HEIC/HEIF to JPG & PNG: convert iPhone photos before removing backgrounds.
  • Download Images from URLs: Bulk Image & File Downloader: collect the source images first.
  • Video Frame Extractor: Keyframes, Scenes & Thumbnails for AI: pull still frames out of a video, then cut out the subject.