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

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). CPU by default; CUDA with onnxruntime-gpu.
  • 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.1

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.1
File Size Uploaded Provenance Actions
bulk_bg_remove-0.1.1.tar.gz 2.7 MB Without provenance Details for bulk_bg_remove-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 2.8 MB

Release files / bulk_bg_remove-0.1.1.tar.gz

Download URL bulk_bg_remove-0.1.1.tar.gz
Size 2.7 MB
Tags Source
SHA-256 checksum
How to use checksums
4b10bbd70e9d1d4d8e4e3ad57a4d8b356777e70eabd3d22a898f8b762e04faed
BLAKE2b-256 checksum
How to use checksums
f992050cd047d363c608ddbae49d89b2bac76b3d15e5892d89c2299f6179f4dc
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.1-py3-none-any.whl

Download URL bulk_bg_remove-0.1.1-py3-none-any.whl
Size 74.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
542daa5a9284bb59e7c09ba23dfc6c3747955cca7a5c59a98d371f3db98fc57c
BLAKE2b-256 checksum
How to use checksums
4bc44d47d5d3e6848e14c63bbd88fdcb92fb0512bc402f74d002f9857e5d4294
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.1

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