Skip to main content

Background Remover

Background Remover hero

A small local utility for removing image backgrounds and exporting transparent PNGs. It runs as a lightweight Flask app and uses rembg with ONNX Runtime for the actual segmentation work.

Features

  • Local browser UI for before/after previews
  • Alpha matting for softer edges
  • Mask-only export mode
  • Disk-backed previews and direct PNG downloads
  • Recent job metadata through /api/jobs
  • Health and identity endpoints for local service checks
  • Cross-platform Python install path for Linux, macOS, and Windows

Quick Start

The fastest path is the bootstrap script. It creates a local virtual environment, upgrades packaging tools, and installs the Python dependencies.

Linux and macOS:

python3 scripts/bootstrap.py
. .venv/bin/activate
background-remover

Windows PowerShell:

py scripts/bootstrap.py
.venv\Scripts\Activate.ps1
background-remover

Open http://localhost:5050 in your browser.

Manual Install

python3 -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e .
background-remover

Windows PowerShell:

py -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e .
background-remover

Runtime Dependencies

The Python package installs:

  • Flask
  • Pillow
  • rembg
  • onnxruntime

rembg fetches model assets on first use. The default model is u2net; override it with BACKGROUND_REMOVER_MODEL if you want to use another model supported by rembg.

See docs/DEPENDENCIES.md for platform notes and troubleshooting.

Configuration

Environment variables:

  • HOST: bind host, defaults to 127.0.0.1
  • PORT: bind port, defaults to 5050
  • BACKGROUND_REMOVER_MODEL: rembg model name, defaults to u2net

Example:

HOST=127.0.0.1 PORT=7860 background-remover

Windows PowerShell:

$env:HOST = "127.0.0.1"
$env:PORT = "7860"
background-remover

Verify

python scripts/preflight.py
python -m unittest discover -s tests -v

Project Status

This is intentionally small: one loopback-only local web app by default, local filesystem outputs, and no hosted service dependency. The main platform-sensitive dependency is onnxruntime, which must provide a wheel for the target OS and CPU architecture.

License

MIT License. See LICENSE.

Metadata

Release files for bgvanish 0.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bgvanish 0.4.3
File Size Uploaded Provenance Actions
bgvanish-0.4.3.tar.gz 13.5 kB Without provenance Details for bgvanish-0.4.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bgvanish 0.4.3
File Interpreter ABI Platform Actions
bgvanish-0.4.3-py3-none-any.whl Python 3 none any Details for bgvanish-0.4.3-py3-none-any.whl

Total release size: 25.5 kB

Release files / bgvanish-0.4.3.tar.gz

Download URL bgvanish-0.4.3.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f379653a0eb8bb97937be137f35421cd01dcf715bc6903e31a9225177e85691a
BLAKE2b-256 checksum
How to use checksums
dc3d0a858198b15adc2b607c4f45402cc8caf70c93f06625c6da80d7980734f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / bgvanish-0.4.3-py3-none-any.whl

Download URL bgvanish-0.4.3-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca54f9888b1c34a4673d05c2ac4339aa0a41e1dcb4b2ea7c50e8cb9622081cb0
BLAKE2b-256 checksum
How to use checksums
59f622989d25172bb8b6306ffe969e2b34933dc61890dc3c39ae0584d69fe8e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Security for bgvanish 0.4.3

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