AI tools, scored for your job
Get paid to train AI
🤝 You're in the Free & Open Source library — community-built tools you can use without paying. A different concept from our scored AI directory.
Home › Free & Open Source › Photographers › rembg
✦ Free & open sourcePhotographers

rembg

Removes image backgrounds from the command line, a Python library, an HTTP server or Docker, using local ONNX models.

Cut out backgrounds from a terminal

A background remover you run as a CLI, Python call, HTTP API or Docker container.

Free forever · open source · MIT
✓ Light setup✓ Browser-based✓ Real-time collaboration
7.9
ZEKAI
Scriptable cutout tool
Free & open source · Photographers
Ease of setup6
Usefulness7
Maintenance9.5
Community9.2
★ 25,443
GITHUB
Nov 2026
UPDATED
MIT
LICENSE
🛠 Don't want to self-host? We can set it up →
⚡ Quick answer

rembg strips the background from an image and hands back a transparent PNG. It suits developers and photo or product teams who want to batch-process folders or call a cutout API from their own code, not click through a web page.

Runs on
Cross-platform
Hosting
Self-host
Languages
Python
License
MIT

What it is

You install it with pip, then run `rembg i` on one file, `rembg p` on a whole folder (with an optional watch mode), or `rembg s` to start an HTTP server. It ships many local ONNX models (u2net, isnet, BiRefNet variants, SAM, bria-rmbg) and four edge modes for hair and fur: naive, colour decontamination, alpha matting and ViTMatte.

Who it's for

Good for developers adding cutouts to an app, and for anyone with hundreds of product shots to process in one go. It is a poor fit if you want a point-and-click editor, and the default model carries a commercial-use catch you need to read first.

Key features

Four edge-refinement modes

Choose naive, -dc decontamination, -a alpha matting or -vm ViTMatte depending on how much hair or fur detail matters.

Folder watch mode

`rembg p -w` processes new or changed files in a folder as they appear.

Built-in HTTP server

`rembg s` exposes a /api/remove endpoint that takes an upload or an image URL, plus a Gradio UI you can switch off.

FFmpeg video pipe

`rembg b` reads raw RGB24 frames from FFmpeg so you can cut out video frame by frame.

Many swappable models

Pick from u2net, isnet-anime, BiRefNet portrait or general, SAM with click prompts, cloth segmentation and more.

Cloud model backends

Optionally route a job to the withoutBG or Atlas Cloud APIs from the same CLI or Python session.

How to start

Up and running in 3 steps

1
Install with `pip install "rembg[cpu,cli]"` (or `rembg[gpu,cli]` if your CUDA setup supports onnxruntime-gpu).
2
Run `rembg i path/to/input.png path/to/output.png` on a test image; the model downloads on first use.
3
Add `-m` to pick a model, `-dc` or `-a` for soft edges, then use `rembg p` for a folder or `rembg s` to start the API.
Real talk

Our honest verdict

What's great

  • One tool covers single files, folders, a Python call, a REST server and a Docker image, so the same cutout code works in a script or a service.
  • SAM support lets you click a point on the subject and cut out only that object, which most one-click background removers cannot do.
  • Dedicated anime, cloth and human-segmentation models exist, so you are not stuck with one general model for every image type.
  • Colour decontamination removes the green or blue rim left on hair, and the README says it is cheap enough to leave on for a whole batch.

Where it falls short

  • The default model, bria-rmbg 2.0, is released under a BRIA licence that the README says requires a paid agreement for commercial use, so you must switch models or pay before using it in a business.
  • That default model is about 1.02 GB and runs at 1024x1024, so first run is a large download and processing is slower than with u2net.
  • Python must be 3.11 to 3.13, and GPU use needs onnxruntime-gpu plus matching CUDA and cudnn, which the README flags as a common snag.
  • There is no graphical editor for touch-ups; fixing a bad edge means re-running with another model or edge flag.
Cost

Pricing & license

rembg is MIT-licensed and costs nothing to run yourself. The optional withoutBG backend offers 50 free credits on signup per the README, and Atlas Cloud is a separate paid API; check each provider for rates. The bria-rmbg model needs a paid BRIA agreement for commercial use.

Paid work

Open remote AI-training roles

767 open remote AI-training roles, updated November 14, 2026; most pay $20–$175 an hour. Zekai lists them free; the application goes to the employer’s platform.

See all open roles →
Compare

Alternatives

🎁 Free & open-source alternatives

These reviewed AI tools do the same job instantly — from our scored directory.

Get more

Use it, or have us set it up

📄 Free PDF: rembg for Photographers
A plain-language guide to getting your first result. Sent to your inbox.
🔔 64 people want a full video tutorial — add your vote
🛠 Don't want to set it up yourself?
We'll install, host & configure rembg for you — and train your team.
Get it done for you ↗
Questions

FAQ

Can I use rembg for commercial work?

The code is MIT. The default bria-rmbg model is under a BRIA licence that, per the README, requires a paid agreement for commercial use, and every model carries its own licence. Check the model source before using it commercially.

Do I need a GPU?

No. `pip install "rembg[cpu]"` runs on CPU. NVIDIA (CUDA) and AMD (ROCm) GPU installs are supported for speed, but they need extra drivers and libraries.

How do I deal with messy hair edges?

The README suggests -dc first for colour halos, -a if the mask shape is wrong, and -vm for the most detail at the cost of an extra download and slower runs.

Radar

Latest AI news

✉️ The weekly free toolkit
The best new free & open-source tools for Photographers — one short email a week, in your language.
Free · 1 email/week · unsubscribe anytime
Get paid to train AI →

See Zekai first in Google