--- id: transparent-background version: "1.3.4" license: unclear license_treatment: permissive maintenance: active --- # transparent-background — Make images with transparent background License: permissive · Maintenance: active · Downloads: 317.3K/mo ## 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 above — 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 pip install transparent-background uv add transparent-background poetry add transparent-background ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 317.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags background removal image video, transparent background tool, salient object detection, remove background deep learning, image segmentation foreground, batch background removal, video background removal, image-segmentation, computer-vision, deep-learning [View on SkillFed](https://skillfed.io/packages/transparent-background) · [View on PyPI](https://pypi.org/project/transparent-background/)