AI tools, scored for your job
Get paid to train AI
🤝 You're in the Free & Open Source library — community-built tools you can use without paying. A different concept from our scored AI directory.
Home › Free & Open Source › Photographers › withoutbg-python
✦ Free & open sourcePhotographers

withoutbg-python

Python SDK for local and cloud background removal using open weights or cloud API

Background removal in Python, local or cloud

Switch between free local open weights and a sharp cloud API with a single line of code

Free forever · open source · Apache-2.0
✓ Light setup✓ Browser-based✓ Real-time collaboration
7.5
ZEKAI
Flexible Python cutout SDK
Free & open source · Photographers
Ease of setup6
Usefulness8
Maintenance9.5
Community6.5
★ 1,271
GITHUB
Oct 2026
UPDATED
Apache-2.0
LICENSE
🛠 Don't want to self-host? We can set it up →
⚡ Quick answer

withoutbg-python is a Python SDK for removing image backgrounds using either local open-weights ONNX models or a cloud API. It suits developers building automated scripts, notebooks, backends, or batch jobs that need flexible execution options.

Runs on
Cross-platform
Hosting
Self-host
Languages
Python
License
Apache-2.0

What it is

The tool provides a unified API to run background removal locally using a router between DINOv3-fused matting and BiRefNet segmentation, or route requests to a cloud API. It returns a PIL Image in RGBA format and supports batch processing with custom progress callbacks.

Who it's for

It suits Python developers and technical photographers building custom image processing pipelines or batch workflows. It does not suit non-technical users looking for a standalone desktop application without writing code.

Key features

Unified API Design

Switch between local open weights and the cloud API with a single line of code.

Batch Processing Support

Process multiple images efficiently while keeping the model loaded in memory.

Progress Callbacks

Track processing progress with custom callback functions for long-running jobs.

Multi-Branch Router

Intelligently routes images between matting and segmentation models based on content.

How to start

Up and running in 3 steps

1
Install the package using your preferred Python package manager such as uv add withoutbg
2
Initialize the model in your script using WithoutBG.open_weights() or WithoutBG.api()
3
Call remove_background() on your image path and save the resulting PIL Image
Real talk

Our honest verdict

What's great

  • Identical API for both local offline execution and cloud processing
  • Supports native PIL Image integration for easy compositing in Python workflows
  • Includes a command-line interface for quick terminal-based background removal
  • First local run automatically downloads necessary ONNX weights from Hugging Face

Where it falls short

  • First local run requires downloading roughly 1.5 gigabytes of model weights
  • Local open weights require maintaining sidecar metadata files if using custom paths
  • Cloud API mode requires a paid API key for processing images
Cost

Pricing & license

The Python SDK and local open weights are free to use under the Apache 2.0 license, while the optional cloud API requires paying per image processed.

Paid work

Open remote AI-training roles

768 open remote AI-training roles, updated November 14, 2026; most pay $20–$175 an hour. Zekai lists them free; the application goes to the employer’s platform.

See all open roles →
Compare

Alternatives

🎁 Free & open-source alternatives

These reviewed AI tools do the same job instantly — from our scored directory.

Get more

Use it, or have us set it up

📄 Free PDF: withoutbg-python for Photographers
A plain-language guide to getting your first result. Sent to your inbox.
🔔 64 people want a full video tutorial — add your vote
🛠 Don't want to set it up yourself?
We'll install, host & configure withoutbg-python for you — and train your team.
Get it done for you ↗
Questions

FAQ

Can I run this completely offline?

Yes, once the initial 1.5 GB model weights are downloaded from Hugging Face, local open-weights mode runs entirely offline.

What image formats are supported for output?

The SDK returns a PIL Image in RGBA format, which can be saved as PNG or WebP to preserve transparency.

How do I handle batch processing efficiently?

Initialize the model once outside your loop and use remove_background_batch() to avoid reloading weights for every image.

Radar

Latest AI news

✉️ The weekly free toolkit
The best new free & open-source tools for Photographers — one short email a week, in your language.
Free · 1 email/week · unsubscribe anytime
Get paid to train AI →

See Zekai first in Google