danielgatis/rembg

Rembg is a tool to remove images background

What it solves

Rembg is a tool designed to remove backgrounds from images, allowing users to isolate the foreground subject from its surroundings. It addresses the common challenge of creating clean cutouts of products, people, or other objects without manual masking.

How it works

The tool uses pre-trained ONNX models (such as bria-rmbg, BiRefNet, and U2-Net) to identify and segment the foreground. It can be deployed as a command-line interface (CLI), a Python library, an HTTP server, or a Docker container. To handle complex edges like hair or fur, it offers several edge-processing modes:

  • Naive: The default mode for hard edges.
  • Decontaminate: Removes colored halos (color fringing) from soft edges.
  • Decontaminate/Alpha Matting: Refines the mask shape for soft, wispy details.
  • ViTMatte: Uses a neural network to predict alpha for high-detail recovery.

Who it’s for

  • Developers who want to integrate background removal into their applications via a Python library or API server.
  • Content Creators who using the CLI for batch processing folders of images.
  • DevOps Engineers who need a deployable Docker container for image processing pipelines.

Highlights

  • Versatile Deployment: Supports CLI, Python library, HTTP server, and Docker.
  • ** uma Variety of Models**: Includes a wide range of specialized models for general use, portraits, anime characters, and clothing segmentation.
  • Hardware Acceleration: Supports CPU, NVIDIA CUDA, and AMD ROCm backends via ONNX Runtime.
  • Advanced Edge Handling: Features color decontamination and alpha matting to ensure professional-quality cutouts.
  • Cloud Integration: Provides optional integration with cloud APIs like withoutBG and Atlas Cloud.

Related

  • Project
  • Project
  • Project
  • Project
  • Project