rembg
Remove image backgrounds from the command line, Python or an HTTP server.
- Stars
- 25.1K
- Forks
- 2.4K
- Open issues
- 2
- Last commit
- 2026-10-10
Live from the GitHub API · updated 2026-10-15
What is rembg?
rembg removes backgrounds with models such as U²-Net, IS-Net and BiRefNet. Use it as a CLI, a Python library, an HTTP server or a Docker container — handy for batch-processing product photos.
Key features
- CLI, Python library and HTTP server
- Multiple segmentation models (u2net, isnet, birefnet, sam)
- Batch folder mode and alpha matting
- Docker image
System requirements
- Platforms
- Windows · macOS · Linux · Docker
- GPU
- Optional (CPU works; install the gpu extra for CUDA)
- Python
- 3.10+
How to install rembg
Summarized from the project’s README. Projects change quickly — check the GitHub page for the latest instructions.
pip
- 1Install with the CLI extra (use [gpu,cli] for CUDA).
pip install "rembg[cpu,cli]" - 2Remove a background.
rembg i input.png output.png - 3Process a whole folder.
rembg p input_folder output_folder
Docker
- 1Run against files in the current directory.
docker run -v .:/data danielgatis/rembg i /data/input.png /data/output.png
Strengths
- Scriptable and fast
- MIT license
Limitations
- No GUI
- Hair and transparent objects can be imperfect
rembg alternatives compared
| Software | Stars | License | Platforms | VRAM |
|---|---|---|---|---|
| rembg Remove image backgrounds from the command line, Python or an HTTP server. | 25.1K | MIT | — | |
| BiRefNet High-resolution dichotomous segmentation — state-of-the-art background removal. | 4.3K | MIT | — | |
| IOPaint Erase objects, watermarks and people with AI inpainting (formerly Lama Cleaner). | 23.3K | Apache-2.0 | — | |
| Upscayl Free desktop app that upscales images with AI. | 50.6K | AGPL-3.0 | — | |
| Real-ESRGAN Practical image and video super-resolution models. | 37.1K | BSD-3-Clause | — | |
| GFPGAN Blind face restoration for old and low-quality photos. | 37.7K | Apache-2.0 | — |
FAQ
Is rembg free?
Yes — rembg is open-source software released under the MIT license. Check the license (and any model weight licenses) before commercial use.
Does rembg run on Windows, Mac and Linux?
rembg supports: Windows, macOS, Linux, Docker.
What hardware do I need for rembg?
Optional (CPU works; install the gpu extra for CUDA)
How do I install rembg?
1. Install with the CLI extra (use [gpu,cli] for CUDA). 2. Remove a background. 3. Process a whole folder.
What are the best rembg alternatives?
Popular alternatives include BiRefNet, IOPaint, Upscayl, Real-ESRGAN. See the comparison table on this page.
Can I use rembg online without installing it?
If you just want results, AiLoft runs top image models such as GPT Image 2.5 and Nano Banana Pro in the browser — no GPU or setup required.
Skip the install — generate images in your browser
No GPU, drivers or Python needed. Use GPT Image 2.5 and Nano Banana Pro online and compare them side by side.