bg-remove: Client-Side Image Background Removal with Transformers.js

This repository profile is provided by osrepos.com, an open source repository discovery platform.

bg-remove: Client-Side Image Background Removal with Transformers.js

Summary

bg-remove is a powerful React + Vite application that enables free, client-side image background removal directly in your browser. Leveraging machine learning models via Transformers.js, it ensures all processing happens locally, prioritizing user privacy. This tool offers one-click removal, custom background options, and optional WebGPU acceleration for enhanced performance.

Repository Information

Analyzed by OSRepos on June 17, 2026

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Introduction

The bg-remove project by Addy Osmani is an innovative, client-side application designed for seamless image background removal. Built with React and Vite, it utilizes the power of Transformers.js to run machine learning models directly within your browser, ensuring that your images never leave your device. This privacy-focused tool offers one-click background removal, customizable background colors or images, and various download options, with optional WebGPU acceleration for supported browsers.

Installation

To get started with bg-remove, follow these simple steps:

  1. Clone the repository:
    git clone https://github.com/addyosmani/bg-remove.git
    
  2. Navigate to the project directory:
    cd bg-remove
    
  3. Install dependencies:
    npm install
    
  4. Start the development server:
    npm run dev
    

Examples

Using bg-remove is straightforward. First, you upload an image file. The application then defaults to using the RMBG-1.4 model for broad compatibility, but if your browser supports WebGPU, you have the option to switch to MODNet for potentially faster processing. After the selected ML model processes your image and creates an alpha mask, you can customize the background with a new color, an image, or keep it transparent. Finally, you can export your processed image with either a transparent or colored background.

Why Use It

There are several compelling reasons to use bg-remove for your image editing needs. Its primary advantage is privacy, as all image processing occurs directly in your browser, ensuring your files remain local and secure. The application is entirely client-side, meaning you don't need to upload sensitive data to external servers. Furthermore, it offers robust performance across all modern browsers with its default RMBG-1.4 model, and provides an optional WebGPU acceleration for even faster results on compatible systems. The intuitive interface and one-click removal make it highly user-friendly for quick and efficient background removal.

Links

For more detailed information, contributions, or to explore the codebase, visit the official GitHub repository:

Source repository

Open the original repository on GitHub.

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️