bgeraser
Remove image backgrounds on your own computer. No uploads, no API keys, no watermarks, no limits.
Works three ways:
| Command line | bgeraser photo.jpg → photo-nobg.png |
| Python library | remove_background("photo.jpg") |
| Local web page | bgeraser serve → drag & drop in your browser |
Powered by open-source U²-Net / ISNet models through rembg.
Install
pip install bgeraser # CLI + library
pip install "bgeraser[web]" # also the drag & drop web page
Needs Python 3.9+. The first run downloads the AI model (about 170 MB for the default isnet-general-use, one time).
Command line
# one image → transparent PNG next to it
bgeraser photo.jpg
# choose the output name
bgeraser photo.jpg -o clean.png
# solid background instead of transparent (product photos, ID photos)
bgeraser photo.jpg --bg white
bgeraser photo.jpg --bg "#00ff00"
# a whole folder → ./products/nobg/
bgeraser ./products
bgeraser ./products -o ./out --recursive
# faster (lower quality) model for big batches
bgeraser --model u2netp ./products
# finer edges for hair / fur (slower)
bgeraser photo.jpg --matting
# list models
bgeraser models
Web page (drag & drop)
bgeraser serve
Then open http://127.0.0.1:5000. Drop, paste, or pick an image; download the PNG. Everything stays on your machine.
bgeraser serve --port 8080 --model isnet-general-use to change port or model.
Python
from bgeraser import remove_background, remove_background_bytes, process_folder
remove_background("photo.jpg") # -> photo-nobg.png
remove_background("photo.jpg", "out.png", bg_color="white")
remove_background("photo.jpg", model="isnet-general-use", alpha_matting=True)
png_bytes = remove_background_bytes(open("photo.jpg", "rb").read()) # in-memory
process_folder("./products", "./products/out") # batch
Models
| name | best for |
|---|---|
isnet-general-use (default) |
cleanest edges — people, products, cars |
u2net |
general, good quality |
u2netp |
fastest, small, rougher edges |
u2net_human_seg |
people / portraits |
isnet-anime |
anime & illustrations |
u2net_cloth_seg |
clothing segmentation |
silueta |
u2net quality, smaller file |
Why
Online background removers are slow, watermark the result, charge per image, or make you upload customer photos to a stranger's server. This does the same job offline, for free, in one command.
Contributing
Issues and pull requests welcome. Run tests with:
pip install -e ".[dev]"
pytest
License
MIT © Tavrej / Yonzon Studio
Metadata
Release files for bgeraser 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bgeraser-0.3.0.tar.gz | 1.7 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bgeraser-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.3 MB
Release files / bgeraser-0.3.0.tar.gz
| Download URL | bgeraser-0.3.0.tar.gz |
|---|---|
| Size | 1.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b44d0ad88b0ee8dfe57a89efa4daecb335fb324ca183f2f9d9d2ef461673405
|
|
BLAKE2b-256 checksum How to use checksums |
c8b9dceac09d03bac93e756d45b9c20e83a5fd70f8af7562adc32dbc93844daa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Release files / bgeraser-0.3.0-py3-none-any.whl
| Download URL | bgeraser-0.3.0-py3-none-any.whl |
|---|---|
| Size | 1.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
665aa11f8523f690401156bf26760b782186a530a8a4a4dd53dae32f22647a2e
|
|
BLAKE2b-256 checksum How to use checksums |
f7e399ca7b0a8c3cb47bae47dbda98530f01fe22d0865f5e763152cf2349fd89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|