skillfed

transparent-background

Make images with transparent background

transparent-background v1.3.4 317.3K downloads/30d#7,663 on PyPI1,276
Permissive license Active released

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-background

uv

uv add transparent-background

poetry

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 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

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

background removal image videotransparent background toolsalient object detectionremove background deep learningimage segmentation foregroundbatch background removalvideo background removal
image-segmentationcomputer-visiondeep-learning

More Artificial Intelligence packages