Background removal that doesn't phone home—unless you want it to
A Python toolkit that swaps between a local ONNX model and a paid API with one line of code, letting you choose privacy or convenience per project.

What it does
withoutbg removes backgrounds from photos. The twist is a dual-mode SDK: WithoutBG.opensource() runs a ~320MB local model (free, offline, needs ~2GB RAM), while WithoutBG.api() calls a hosted service for better quality without the hardware burden. Same interface, different tradeoffs.
The project also ships a Dockerized web app (React + FastAPI) and plans plugins for GIMP, Photoshop, and Figma. Everything returns standard PIL Image objects in RGBA, so you can chain it into normal Python image workflows.
The interesting bit
The local model isn’t a single network—it’s a four-stage pipeline (ISNet segmentation → Depth Anything V2 guidance → Focus Matting → Focus Refiner) that specifically targets hair and fur edges, the usual failure mode for matting models. The README is unusually honest about when to use which mode: local for batch jobs and privacy, API for production services where managing 2GB of model weights is infrastructure you don’t want.
Key highlights
- Local model downloads 320MB of ONNX weights on first run, then processes images in 2–5 seconds on CPU
- API mode requires only a key, no GPU or model management
- CLI supports batch processing with
--batchand format conversion (including silent JPEG flattening when alpha channels get discarded) - Web app deploys via Docker on both amd64 and arm64
- Monorepo structure separates packages, apps, and future integrations
Caveats
- The “Next Gen Model” badge promises something coming February 2026, which is either confident roadmap planning or placeholder optimism
- Integrations (GIMP, Photoshop, Figma, Blender) are listed as “Coming Soon” with no timeline
- Reinitializing the local model object for each image reloads 2GB of weights, making it 10–100× slower; the README has to explicitly warn users not to do this in a loop
Verdict
Worth a look if you need background removal in a Python pipeline and want the escape hatch of local processing without committing to self-hosting forever. Skip if you just need a web tool—there are simpler options, and the local model’s 2GB RAM requirement is real.
Frequently asked
- What is withoutbg/withoutbg-python?
- A Python toolkit that swaps between a local ONNX model and a paid API with one line of code, letting you choose privacy or convenience per project.
- Is withoutbg-python open source?
- Yes — withoutbg/withoutbg-python is an open-source project tracked on heatdrop.
- What language is withoutbg-python written in?
- withoutbg/withoutbg-python is primarily written in Python.
- How popular is withoutbg-python?
- withoutbg/withoutbg-python has 1.2k stars on GitHub and is currently cooling off.
- Where can I find withoutbg-python?
- withoutbg/withoutbg-python is on GitHub at https://github.com/withoutbg/withoutbg-python.