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.
Mask Only
Generate only the mask (black/white) instead of the full processed image.
Custom Background
Replace the background with a custom color using color picker and transparency.
Session Reuse
Reuse sessions for better performance when processing multiple images.
Progress Tracking
Track progress during background removal with real-time updates and step indicators.
Cloth Segmentation
Advanced clothing segmentation with multiple mask outputs for different clothing categories.
Global Usage
Use rembg-web via global variables (UMD build) instead of ES module imports.
Pixel Comparison
Compare two images pixel by pixel and highlight differences for testing and validation.
Model Selection
Choose between different AI models for background removal with detailed information about each model's strengths and use cases.
Batch Processing
Process multiple images at once using the fastest model (U2NetP) and download all results as a ZIP file.
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.