rembg
$ rembg Community Med Riskrembg removes image backgrounds locally using ONNX segmentation models via single-file (rembg i), batch-directory (rembg p), and HTTP server (rembg s) subcommands. Note that the first invocation downloads ~176 MB+ model weights into ~/.u2net/ unless pre-cached.
pip install "rembg[cpu,cli]" Local ONNX inference on image files (rembg i / rembg p) avoids sending images to external APIs or MCP servers.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Click-based subcommands (i, p, s) support stdin/stdout and non-interactive flags, though lack JSON output, --dry-run, and quiet suppression for model download progress.
- Non-interactive
rembg iandrembg psubcommands - First-run model download prints progress bars to stdout/stderr
Requires distinct output path (rembg i in out), but silently triggers external HTTPS downloads of ~176 MB+ model files into ~/.u2net on first run.
- Implicit network download of ONNX weights on first run per model
Heavy Python + ONNX Runtime + Pillow/SciPy dependency tree (rembg[cpu,cli]), not packaged in Homebrew core and sensitive to Python version compatibility.
- Requires
pip install "rembg[cpu,cli]"with heavy ML runtime dependencies
High-quality local background removal supporting U2Net, BiRefNet, and anime/human segmentation models plus batch directory mode (rembg p).
- Supports multiple specialized segmentation models via
-m
Popular MIT-licensed repository (danielgatis/rembg) with ongoing model additions.
- Maintained at
danielgatis/rembgon GitHub
Clear README CLI examples and rembg <cmd> --help, though upstream model licensing must be checked separately.
- Usage documented in GitHub README and
--help
Security, Auth & Guardrails
None required; caches downloaded ONNX model weights in ~/.u2net (overridable via U2NET_HOME).
Free MIT open-source Python CLI; individual ONNX model weights carry their own upstream licenses.
# rembg Agent Rules - First run with a new `-m <model>` downloads ~176 MB+ ONNX weights from GitHub into `~/.u2net`—allow network or pre-populate `U2NET_HOME`. - Always output `.png` or `.webp` so alpha transparency is preserved, and avoid `rembg s` server mode unless an HTTP daemon is explicitly needed.
Agent-Ready Command Recipes
Safe Read-Only Queries
rembg i --help
Prints supported model names (u2net, isnet-general-use, birefnet-general) and alpha-matting flags without downloading weights.
Controlled Writes & Previews
rembg i -m u2net input.jpg cutout.png
Segments foreground from input.jpg and writes a transparent RGBA PNG to cutout.png.
Strengths for Agents
- + Runs state-of-the-art background segmentation (U2Net, BiRefNet) completely locally.
- + Supports single-file (
rembg i), stdin/stdout piping, and batch directory (rembg p) workflows.
Caveats & Pitfalls
- ! First execution per model downloads large (~176 MB+) ONNX weights from GitHub into
~/.u2net. - ! Heavy Python/ONNX Runtime dependency tree with slower startup than native binaries.