Spaces:
Sleeping
A newer version of the Streamlit SDK is available: 1.55.0
title: Background Remover
emoji: π»
colorFrom: indigo
colorTo: blue
sdk: streamlit
sdk_version: 1.54.0
python_version: '3.10'
app_file: src/app.py
pinned: false
license: agpl-3.0
π¨ Background Remover
A powerful, user-friendly desktop application for removing image backgrounds and replacing them with custom colors. Built with Streamlit and powered by state-of-the-art AI models.
β¨ Features
- πΌοΈ Batch Processing - Upload and process multiple images at once
- π€ Multiple AI Models - Choose from 7 different background removal models
- π¨ Custom Background Colors - Replace backgrounds with any color you choose
- π Transparency Options - Keep transparent backgrounds or fill with solid colors
- π¦ Bulk Download - Download all processed images as a convenient ZIP file
- β‘ Real-time Preview - See original and processed images side by side
- π₯οΈ Desktop-First Design - Clean, intuitive interface built for productivity
π Quick Start
Prerequisites
- Python 3.11 or higher
- pip package manager
Installation
Clone the repository
git clone <repository-url> cd background-removerInstall dependencies
Using the project file:
pip install -e .Run the application
streamlit run src/app.py
The app will open in your default web browser at http://localhost:8501
π Usage
Select Your Preferences
- Choose a background color using the color picker
- Select an AI model (recommended:
birefnet-disfor objects with holes) - Choose transparency mode: keep transparent or fill with color
Upload Images
- Click "Browse files" or drag and drop
- Supports PNG, JPG, and JPEG formats
- Upload single or multiple images
Process Images
- Click "π Process All Images"
- Watch the progress bar as images are processed
- Review results in the side-by-side comparison view
Download Results
- Click "π₯ Download All" to get a ZIP file
- All images are saved as PNG to preserve quality
π€ Available AI Models
| Model | Best For | Performance |
|---|---|---|
| birefnet-dis | Objects with holes/details | βββββ |
| birefnet-general-lite | Fast general-purpose | ββββ |
| birefnet-general | High-quality general use | βββββ |
| isnet-general-use | General purpose | ββββ |
| u2net | Legacy general use | βββ |
| birefnet-massive | Maximum accuracy | βββββ |
| bria-rmbg | Commercial-grade | ββββ |
π οΈ Tech Stack
- Streamlit - Web application framework
- rembg - AI-powered background removal
- Pillow - Image processing
- NumPy - Numerical operations
- ONNX Runtime - AI model inference
π Requirements
streamlit>=1.30
rembg>=2.0.50
pillow>=10.0
numpy>=1.24
onnxruntime>=1.17
π€ Contributing
Contributions are welcome! This project is licensed under AGPL-3.0, which means:
- β You can use, modify, and distribute this software
- β You must share your modifications under the same license
- β You must make source code available for network use (SaaS)
Please feel free to:
- Report bugs
- Suggest features
- Submit pull requests
π License
Copyright (c) 2026-present Kacper Kozaczko
This project is licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later).
See LICENSE for full terms.
Third-Party Components
This software includes the following third-party components:
- rembg - Copyright (c) 2020-present Daniel Gatis
License: MIT - See LICENSES/MIT-rembg.txt
β οΈ Disclaimer
This software is provided "as is" without warranty of any kind. The AI models used for background removal may not be perfect for all images. Results may vary depending on image quality and complexity.
π Acknowledgments
- Thanks to Daniel Gatis for the excellent rembg library
- Built with β€οΈ using Streamlit
Made with π¨ and Python