transparent-background
Make images with transparent background
What it is and what it does
Transparent Background is a background removal tool built on the InSPyReNet deep learning model (ACCV 2022). It takes images, videos, or webcam streams and produces output with transparent backgrounds or custom replacement backgrounds. The package wraps a pre-trained segmentation model and handles the full pipeline: loading input, running inference, estimating foreground color (optionally with GPU acceleration via pymatting), and writing output in multiple formats.
You can use it three ways: as a command-line tool with options for resize mode, output format, and batch processing; as a Python API for integration into larger workflows; or through a GUI (requires optional flet dependency). The model supports multiple inference modes (base, fast, base-nightly) trading off speed and detail. Core dependencies include torch, torchvision, opencv-python, timm, kornia, and albumentations for image processing.
Use it for:
- Batch remove backgrounds from product photos for e-commerce listings
- Extract foreground subjects from video frames for compositing or analysis
- Preprocess images for machine learning pipelines that require transparent or uniform backgrounds
- Real-time webcam background removal for streaming or video conferencing (Linux only, optional)
- Create cutout images for graphic design or document preparation
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Removes backgrounds from images and videos using a deep learning model (InSPyReNet), producing transparent or custom-background output via command-line, Python API, or GUI.
Yes, if you need background removal and can accept PyTorch as a dependency. The package is actively maintained, permissively licensed, and widely used. Install friction is low for standard use cases. Avoid if you need stable small-image handling without workarounds, or if webcam support on non-Linux platforms is critical—both are documented limitations.
Install
transparent-background on PyPI
pip
pip install transparent-backgrounduv
uv add transparent-backgroundpoetry
poetry add transparent-backgroundInstalling transparent-background
Before you install
Low friction: pure Python wheel with no compiled dependencies beyond PyTorch. Active maintenance with recent commits; last release 457 days ago. Requires PyTorch and torchvision, which are large downloads but standard for ML workflows.
License in practice
MIT license (permissive): you can use, modify, and distribute freely in commercial or private projects with minimal restrictions.
Quickstart
pip install transparent-background
from transparent_background import Remover
remover = Remover()
output = remover.remove(input_source='image.jpg')
Requires PyTorch (1.7.1+) and torchvision (0.8.2+); GPU optional but recommended for speed. Model weights auto-download on first use via gdown.
Verify before relying
- Whether the package works reliably on small images without the --mode fast argument (description notes ongoing work on this issue)
- Stability and platform support for webcam input (marked as not stable; requires optional dependencies and OS-specific setup)
- Performance characteristics and memory requirements for video processing
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 13 — torch, torchvision, opencv-python, timm, tqdm, kornia, gdown, wget, easydict, pyyaml, albumentations, albucore, pymatting |
| Maintenance | actively maintained — 457 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 317,274/month — #7,663 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: transparent_background-1.3.4-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
PyMattingPyMatting solves the alpha matting…
permissive · top 5,000 on PyPI
clip-interrogatorGenerates natural-language prompts from images…
permissive · top 15,000 on PyPI
scenedetectDetects scene cuts and shot changes in videos,…
permissive · top 5,000 on PyPI
rembgRemoves image backgrounds using deep learning…
permissive · top 5,000 on PyPI
youtube_dlCommand-line tool to download videos from…
permissive · top 15,000 on PyPI
deepfilternetDeepFilterNet removes background noise from…
permissive · top 15,000 on PyPI
sahiSAHI performs sliced inference on large images…
permissive · top 15,000 on PyPI
resize-rightResizes images or tensors in NumPy or PyTorch…
permissive · top 15,000 on PyPI
invisible-watermarkEmbeds and decodes invisible watermarks into…
permissive · top 15,000 on PyPI
torchvisionTorchvision provides pre-built datasets, model…
permissive · top 1,000 on PyPI