nadermx/backgroundremover
Background Remover lets you Remove Background from images and video using AI with a simple command line interface that is free and open source.
📋 Changes
- Fall back to `moviepy.editor` import when the moviepy-2.x top-level import is unavailable
- Use `Clip.resized()` (moviepy 2.x) or `Clip.resize()` (moviepy 1.x), whichever exists
- Shim `Image.ANTIALIAS` -> `LANCZOS` (removed in Pillow 10), which moviepy 1.x's resize references
- Relax dependency pin to `moviepy>=1.0.3`
📦 Highlights
- ProRes 4444 default: Transparent video output now defaults to `prores_ks` with `yuva444p10le` (10-bit color with alpha) instead of `qtrle`. Much better compression, color fidelity, and NLE compatibility (DaVinci Resolve, Premiere, Final Cut Pro). The old `qtrle` codec is still available via `--alpha-codec qtrle`.
- Smart worker scaling: Worker count (`-wn`) is now dynamically capped based on your actual GPU VRAM rather than a hard limit. The tool calculates per-worker memory (CUDA context + model + JIT trace + batch tensors) and prevents over-allocation that caused hangs.
- Mask threshold for sharp edges: New `-mt`/`--mask-threshold` option binarizes the alpha mask at a given threshold (0-255) for hard/crisp cutouts — ideal for cartoonish images, logos, and illustrations.
- Device diagnostics: Prints detected device, GPU name, and VRAM at startup so you can verify GPU acceleration is working.
✨ New CLI Flags
- | Flag | Description |
- |------|-------------|
- | `-mt 128` / `--mask-threshold 128` | Binarize mask for sharp edges (0-255) |
🐛 Fixes
- #181: Video processing hanging with high worker counts — workers now dynamically capped to what GPU VRAM can support.
- #122: Soft/blurry edges on cartoonish images — new `--mask-threshold` option for hard cutouts.
- #145: No indication of GPU usage — now prints device info (CUDA/MPS/CPU) with GPU name and VRAM at startup.
💥 Breaking Changes
- Default transparent video codec changed from `qtrle` to `prores_ks`. Output files will be smaller with better color but require ProRes-compatible playback. Use `--alpha-codec qtrle` for the old behavior.
📦 Upgrade
- ```bash
- pip install --upgrade backgroundremover
- ```
📋 Changes
- Video pipeline stability and compatibility improvements across transparent outputs.
- #44: Use exact detected frame rate to reduce alpha mask drift.
- #85: Explicitly map filtered video + optional audio so outputs aren’t “audio only.”
- #49, #86: Added --alpha-codec / --alpha-pix-fmt options to control alpha video encoding; lossless default remains qtrle.
- #98, #88, #152: More robust alpha merge pipeline and encoding options improve results on problematic videos.
- #168: Corrected mask usage in transparentvideooverimage so alpha is applied consistently.
- New CLI flags: --alpha-codec (auto, qtrle, prores_ks, libvpx-vp9) and --alpha-pix-fmt.
- README updated with alpha codec guidance and framerate override examples.
Fix requirement minimum
📋 Changes
- GUI application added (PR #175)
- Background image now optional, doesn't hang on stdin (PR #179)
- Better CLI validation with helpful error messages
- Improved multiprocessing error handling
- Warning for high worker counts
📋 Changes
- Fixed error running on Docker (#176)
- Resolved issue where Docker always downloads models (#105)
- Fixed video background remover not working in Docker (#120)
- Fixed transparent .mov files not being created (#135)
- Resolved video removal producing mask only (#134)
- Fixed invalid argument error when creating transparent mov files (#115)
- Fixed overlay transparent over image with "invalid value" error (#116)
- Fixed RuntimeError: operator torchvision::nms does not exist (#172)
- + 10 more
Had a issue with requirements and importing moviepy
Issue with Moviepy import. Bump version
Fix longstanding video import issue. Upgrade moviepy
Closes issues #99 , #143 , #130 Added in Batch processing of videos or images by folder. Updated readme to reflect.
Add https://github.com/nadermx/backgroundremover/issues/155 to version. Pinning moviepy error
Proper release of GPU cache thanks @Isalia20 Also close https://github.com/nadermx/backgroundremover/issues/142 issue between mismatch of version 0.2.7 and the pypi distribution.
Fix an issue bad naming of variable. A thank you to @ya0guang Update readme with how to use backgroundremover as a library and made a pull request fixing the circular imports for it to work correctly. A thank you to @ahmad88me Fix an issue with moviepy requirments.
Take out shlex, put commands from subprocess into list before.
Let ffmpeg log alphamerge to see if helps shine 0kb error
Closes issue https://github.com/nadermx/backgroundremover/issues/84
Fixes https://github.com/nadermx/backgroundremover/issues/78 and https://github.com/nadermx/backgroundremover/issues/80
Fix issue #18 for Mac users Fix issue with inputs of videos with special characters Fix spelling issues in read me
Fix issues with windows. Fix issues with download files from google vs github. Fix issue with remove background from local video and overlay it over an image Fix issue with frame_rate detection on some videos
Fix issue with u2net import, where would re download existing libraries on system.
Fix relative import issue
Reduce requirements due to upload of wrong file last push, and tesed on python 3.6, 3.7, 3.8, 3.9
v.0.1.6 Refactor import function download, removing duplicate downloads, migrate to gdown for u2net library dependencies to close issue https://github.com/nadermx/backgroundremover/issues/2
Believe this fixes cuda spawn issue
Fix import issue
Fixes multiprocessing sub process issue
Initial commit
