Examples

Explore interactive examples demonstrating different features and use cases of rembg-web. Each example is fully functional and can be run directly in your browser.

Basic Usage

Simple background removal with file input and side-by-side comparison.

File Input Progress Tracking Error Handling
Try Example

Mask Only

Generate only the mask (black/white) instead of the full processed image.

Mask Generation Grayscale Output Custom Backgrounds
Try Example

Custom Background

Replace the background with a custom color using color picker and transparency.

Color Picker RGBA Support Real-time Preview
Try Example

Session Reuse

Reuse sessions for better performance when processing multiple images.

Performance Batch Processing Model Selection
Try Example

Progress Tracking

Track progress during background removal with real-time updates and step indicators.

Progress UI Step Indicators Timestamps
Try Example

Cloth Segmentation

Advanced clothing segmentation with multiple mask outputs for different clothing categories.

Multi-mask Clothing Categories Advanced AI
Try Example

Global Usage

Use rembg-web via global variables (UMD build) instead of ES module imports.

UMD Build Global Variables CDN Ready
Try Example

Pixel Comparison

Compare two images pixel by pixel and highlight differences for testing and validation.

Image Comparison Difference Detection Testing Tools
Try Example

Model Selection

Choose between different AI models for background removal with detailed information about each model's strengths and use cases.

Model Selection 7 AI Models Use Case Guidance
Try Example

Batch Processing

Process multiple images at once using the fastest model (U2NetP) and download all results as a ZIP file.

Bulk Processing ZIP Download Performance Stats
Try Example

Running Examples Locally

To run these examples locally, you'll need to serve them from a web server:

# Quick start with development server
yarn examples

# Or with Python
python3 -m http.server 8080

# Or with Node.js
npx http-server -p 8080

Important: Examples must be served through an HTTP server to work properly due to CORS restrictions.