Background Remover: transparent PNG cutouts in bulk avatar

Background Remover: transparent PNG cutouts in bulk

Pricing

from $20.00 / 1,000 background removeds

Go to Apify Store
Background Remover: transparent PNG cutouts in bulk

Background Remover: transparent PNG cutouts in bulk

Removes the background from every image URL you list with BiRefNet, running inside the actor with no outside API. Transparent PNG or WebP at full resolution, or any solid background color, with optional crop to the subject and a black and white mask.

Pricing

from $20.00 / 1,000 background removeds

Rating

0.0

(0)

Developer

Ed Rayyis

Ed Rayyis

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Categories

Share

Give it a list of image URLs and it cuts the subject out of each one with BiRefNet, an open segmentation model. The model runs inside the actor, so your images go to no outside API and there is no key to set up. You get a transparent PNG or WebP at the full size of the original, or the subject placed on any solid color.

What it does

  • Removes the background from photos and keeps the subject at the original resolution.
  • Transparent or colored background. Leave the color empty for transparency, or set one such as #ffffff, white or #0000ff80 (half transparent blue).
  • Cleans edge colors. The old background's color is taken out of hair, fur and other soft edges. On a photo of a black puppy on a gray wooden deck, the soft edge pixels averaged a brightness of 62 without this step and 11 with it.
  • Crops to the subject if you ask, with a margin you choose.
  • Saves the mask if you ask: a black and white PNG where white is the subject, for your own compositing.
  • Turns photos upright from their EXIF orientation first, so portrait photos stay portrait.
  • Handles many images in one run. Each image gets its own result, and one bad link never stops the run.

Reads JPEG, PNG, WebP, GIF, BMP, TIFF and the other formats Pillow reads. A PNG that already has transparency keeps its transparent areas. An animated GIF is processed from its first frame, and the item says so in note. When the model finds no subject, such as on a plain gray image, the item says so in note.

Input

  • Image URLs (required)
  • Output format: PNG (default), WebP or JPEG. JPEG has no transparency, so it always gets a background color, white unless you set one.
  • Background color (default empty, for transparency)
  • Clean edge colors (default on)
  • Crop to subject (default off) and crop margin in pixels (default 0)
  • Also save the mask (default off)
  • Quality (default 90), for JPEG and WebP
  • Largest source image in megapixels (default 16, ceiling 25). A larger source gets an error item and is not charged.
  • Maximum file size in MB (default 25)

Output

Dataset: one item per URL with outputUrl (download link), outputKey, outputFormat, outputWidth, outputHeight, transparent, foregroundPercent (the share of the image that is subject), cropBox when cropped, maskUrl and maskKey when the mask is saved, inputWidth, inputHeight, outputBytes and processingSeconds. Files are named by their position in your list and the source file name, such as 0001-photo-cutout.png and 0001-photo-mask.png.

A URL that cannot be processed gets ok: false and an error, such as HTTP 404, an unknown host, a file over the size limit, a source over the megapixel limit, or "the file is not an image format this actor can read" for a web page.

Speed

The model runs on the CPU at 1024 by 1024 whatever the source size, and the mask is then scaled to the full image. At the default 4 GB of memory, an 800 by 600 photo took 14 seconds and a 4000 by 4000 photo took 25 seconds.

Model and license

BiRefNet lite, by Peng Zheng and coauthors, released under the MIT License. The edge color cleanup uses blur fusion foreground estimation, as in the BiRefNet code.

Pricing

Pay per event: one event per image processed. URLs that fail are not charged. The run stops when it reaches the maximum charge you set.

Scope and conduct

Only the URLs you supply are downloaded. The actor does not log in anywhere and uses no proxies. Process images you have the right to use.

Support

Questions and problems: the Issues tab on this page. Replies are written by an AI assistant on behalf of the developer and reviewed by the developer.