Skip to main content

bulk-bg-remove logo: a pixel-art monitor showing a green vase with a pink tulip on a transparency checkerboard

bulk-bg-remove

Every photo in the folder. No background. Nothing leaves your machine.

works with license PyPI

Demo: an agent is asked to remove the background from every photo in a folder; a bottle of olive oil loses its background, a reviewer catches background left by a cat's ear and keeps the redone cut-out, the products switch between white, mint and rose backgrounds and land in an online store

Other skills run a model. This one checks every cut-out and redoes the bad ones.

11 models benchmarked on 80 hard images, judged blind at zoom.
The default scored 8.6/10 on real product catalogue photos, the best of the 11, at 3.2 s per photo on a laptop CPU.
Apple M5, CPU only, one worker. Method, every score and the RAM numbers: BENCHMARK.md.

What it is

An agent skill plus the engine behind it. Ask your coding agent to "remove the background from every photo in this folder" and it:

  1. installs the engine (one uv tool install, ~500 MB with Python),
  2. checks your machine (free RAM, formats) and plans the run,
  3. looks at a sample, picks the best model that fits your free RAM (BiRefNet when there is room), and cuts out every image in a queue or in parallel depending on RAM and CPU,
  4. has a second agent, with fresh eyes, review the cut-outs on black and on white, redo the bad ones with a better setting and keep whichever version is better (clean product shots that pass a strict chroma-key check skip this review),
  5. tells you what worked, what failed and why.

Output goes to a new <name>-no-bg/ folder next to the input. Originals are never touched, and the subject's pixels are copied bit for bit: only the alpha channel is new.

Selling online? --shop puts every product on white, square, 2000 px and ready to upload; --background "#E6F6EA" uses your brand colour instead.

Four before-and-after pairs: three friends by train tracks, a black camera on black, a bottle of olive oil, and a white bicycle against a wall, each cut out onto a transparency checkerboard

Reads JPG, PNG, HEIC, WebP, AVIF, TIFF and BMP (by content, not extension), follows EXIF rotation, and handles CMYK, 16-bit and 45 MP photos.

Install

Any agent (skills CLI, needs Node.js 22.20 or newer):

npx skills add Btike/bulk-bg-remove
Claude Code
/plugin marketplace add Btike/bulk-bg-remove
/plugin install bulk-bg-remove@bulk-bg-remove
Codex
codex plugin marketplace add Btike/bulk-bg-remove
codex plugin add bulk-bg-remove@bulk-bg-remove
Just the command, no agent
uv tool install bulk-bg-remove
bulk-bg-remove ~/Pictures/products          # → ~/Pictures/products-no-bg/
bulk-bg-remove                              # opens a drag-and-drop page in your browser

Use it in your browser

No agent needed: the engine has a local page for people.

uvx bulk-bg-remove                          # or `bulk-bg-remove` once installed
bulk-bg-remove ~/Pictures/products --ui     # open it with a folder already loaded

Drop photos or a folder (or type a path), pick a model and press Start. You watch each photo go from the queue to its own progress bar, then the results split into Passed (the automatic check proved the cut-out clean), Check by eye and Failed. Open any result to compare it with the original on black, white or a checkerboard, zoom in on the edges, and Try again with other settings if it needs it.

The page runs on 127.0.0.1 only and nothing is uploaded. Press Ctrl+C in the terminal to stop it; --no-browser prints the address instead of opening it.

Which model it picks

You do not choose: the agent looks at a few of your photos, tells the engine what kind they are, and the engine takes the best model for that kind that fits in your free RAM. Scores are from a blind-judged benchmark (0–10):

Your photos Best model With little RAM (~4 GB free)
Products, objects birefnet-general-lite 8.6 silueta 8.1, used on its own
Hair, fur, plants, wires birefnet-general 7.6 silueta 5.2, only if you say yes
People birefnet-general 7.8 silueta 5.8, only if you say yes
Busy scenes birefnet-general 6.3 silueta 4.0, only if you say yes
Drawings, anime isnet-anime 9.0 needs ~5 GB free

Options

Flag What it does
--profile uniform|complex|people|scene|drawing what the photos are; the model follows
--model NAME force a model instead of auto
--format webp|jpg smaller lossless files (PNG by default); JPEG only with a background
--shop ready for a shop: white, square, product filling ~85%, 2000 px, JPEG
--background white|#RRGGBB a solid colour behind the subject
--square · --pad PCT · --size PX square canvas · margin around the subject · longest side
--clean-edges remove the old background's colour halo from hair and fur edges
--fast-edges skip edge matting: faster, coarser hair
--review-sheets sheets and close-ups for reviewing the cut-outs that need it
--review-all with --review-sheets: also sheet the ones the chroma-key check certified
--only FILE redo just some images, keeping their output names
--max-megapixels MP leave larger photos for another run (short on RAM)
--dry-run --json scan and plan only; one JSON event per line for agents
doctor check the machine, and what auto would pick right now

Requirements

  • Tested on macOS (Apple silicon), Linux and Windows, with a real-model run on each in CI (Python 3.11–3.13). Runs on the CPU. GPU support (CUDA, DirectML) is planned; installing onnxruntime-gpu by hand is not supported.
  • 3.5 GB of free RAM is enough for product photos: the engine picks the best model that fits (about 12 GB gets the best ones). For hair, fur and plants a light model is clearly worse, so the agent asks before using one.
  • The model downloads once (~220 MB). After that everything runs offline.

Credits

Built on rembg and BiRefNet. Showcase and demo photos (CC0, via Wikimedia Commons): Priscilla Du Preez, Dennis Klein, margenauer, Natasza Remesz, Mona Magnussen, Tiko Giorgadze, Dmitry Ratushny. The demo film is drawn in code (GSAP, rendered frame by frame in headless Chromium) from the engine's real output.

License

MIT — see LICENSE.

Metadata

Release files for bulk-bg-remove 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bulk-bg-remove 0.1.2
File Size Uploaded Provenance Actions
bulk_bg_remove-0.1.2.tar.gz 2.7 MB Without provenance Details for bulk_bg_remove-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bulk-bg-remove 0.1.2
File Interpreter ABI Platform Actions
bulk_bg_remove-0.1.2-py3-none-any.whl Python 3 none any Details for bulk_bg_remove-0.1.2-py3-none-any.whl

Total release size: 2.8 MB

Release files / bulk_bg_remove-0.1.2.tar.gz

Download URL bulk_bg_remove-0.1.2.tar.gz
Size 2.7 MB
Tags Source
SHA-256 checksum
How to use checksums
04ac64bd09c0bb24e3fdfc40d366c8279aec8389d35974a441bf0c08dc357d87
BLAKE2b-256 checksum
How to use checksums
fc8c7c593672190e1cba683bbf5eb5e9ce0f5fc0f9640b22bd503146d9c72092
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / bulk_bg_remove-0.1.2-py3-none-any.whl

Download URL bulk_bg_remove-0.1.2-py3-none-any.whl
Size 99.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9aea6e00f8b5b32bf53bc97b1e9a9d0d4761d738763a0010fd611d2b2ed606b
BLAKE2b-256 checksum
How to use checksums
30e1bf546dbfb14bd7068c1be288c8d4e36c49da2c6eef17cffecb19bef809e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for bulk-bg-remove 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page