skillfed

rembg

Remove image background

rembg v2.0.78 3.7M downloads/30d#2,509 on PyPI24,254
Permissive license MIT Active released

What it is and what it does

This package is a background removal tool built on deep learning models that strips backgrounds from images and returns them with transparency. It works with multiple input formats—bytes, NumPy arrays via scipy/scikit-image, or file paths—and can be used as a Python library, command-line tool, HTTP server, or Docker container. The package depends on core image processing libraries (pillow, scikit-image, scipy, numpy) and uses pooch for model management and tqdm for progress reporting.

The library supports multiple backends: CPU-only for universal compatibility, NVIDIA/CUDA for GPU acceleration on compatible systems, and AMD/ROCm for Radeon GPUs. It also integrates with the withoutBG cloud API as an alternative to local processing. Batch processing with session reuse is recommended for performance when handling multiple images. jsonschema is used for configuration validation.

Use it for:

  • Remove backgrounds from product photos for e-commerce listings or catalog preparation
  • Batch process entire folders of images with watch mode for automated workflows
  • Serve background removal as an HTTP API endpoint for web applications or backends
  • Extract foreground objects from images for compositing or further manipulation
  • Process video frames via FFmpeg piping for background removal in video workflows

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Removes image backgrounds using deep learning models, available as a Python library, CLI tool, HTTP server, or Docker container.

Yes. Actively maintained, no known vulnerabilities, low install friction, and flexible deployment options (library, CLI, server, Docker). MIT license is permissive. Choose it for local background removal with optional GPU acceleration; consider the withoutBG cloud API integration if you prefer managed processing.

Install

rembg on PyPI

pip

pip install rembg

uv

uv add rembg

poetry

poetry add rembg

Installing rembg

Before you install

Low install friction with a pure-Python wheel. Active maintenance—released 8 days ago with 24254 GitHub stars. Requires Python >=3.11, <3.14. Optional GPU acceleration (NVIDIA/CUDA or AMD/ROCm) requires system-level dependencies; CPU-only installation is straightforward.

License in practice

MIT license permits commercial and private use with minimal restrictions, making it suitable for most projects.

Quickstart

pip install "rembg[cpu]"

from rembg import remove

with open('input.png', 'rb') as i:
    with open('output.png', 'wb') as o:
        input_data = i.read()
        output = remove(input_data)
        o.write(output)

Requires Python >=3.11, <3.14. GPU support (NVIDIA/CUDA or AMD/ROCm) requires additional system-level dependencies; CPU-only mode works without them.

Verify before relying

  • Model download and caching behavior (pooch is a dependency but caching strategy not specified)
  • Performance characteristics and memory requirements for different image sizes
  • Accuracy and speed comparisons across supported model variants

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies 8 — jsonschema, numpy, pillow, pooch, pymatting, scikit-image, scipy, tqdm
Maintenance actively maintained — 8 days since the last release
Last repo commit
First released
Downloads 3,741,705/month — #2,509 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: rembg-2.0.78-py3-none-any.whl

Keywords: remove, background, u2net

License :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: MathematicsTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

remove image backgroundbackground removal deep learningimage segmentation librarybatch background removalbackground removal apiautomated background strippingimage processing neural network
image-processingdeep-learningbatch-processing

More Software Development packages