Spaces:
Sleeping
Sleeping
File size: 4,521 Bytes
3dfadbc 5a2b642 3dfadbc 5a2b642 3dfadbc 5a2b642 3dfadbc ba52c60 5a2b642 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | ---
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
1. **Clone the repository**
```bash
git clone <repository-url>
cd background-remover
```
2. **Install dependencies**
Using the project file:
```bash
pip install -e .
```
3. **Run the application**
```bash
streamlit run src/app.py
```
The app will open in your default web browser at `http://localhost:8501`
---
## π Usage
1. **Select Your Preferences**
- Choose a background color using the color picker
- Select an AI model (recommended: `birefnet-dis` for objects with holes)
- Choose transparency mode: keep transparent or fill with color
2. **Upload Images**
- Click "Browse files" or drag and drop
- Supports PNG, JPG, and JPEG formats
- Upload single or multiple images
3. **Process Images**
- Click "π Process All Images"
- Watch the progress bar as images are processed
- Review results in the side-by-side comparison view
4. **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](https://streamlit.io)** - Web application framework
- **[rembg](https://github.com/danielgatis/rembg)** - AI-powered background removal
- **[Pillow](https://python-pillow.org/)** - Image processing
- **[NumPy](https://numpy.org/)** - Numerical operations
- **[ONNX Runtime](https://onnxruntime.ai/)** - 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](https://github.com/Repcak00)
This project is licensed under the **GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later)**.
See [LICENSE](./LICENSES) for full terms.
### Third-Party Components
This software includes the following third-party components:
- **[rembg](https://github.com/danielgatis/rembg)** - Copyright (c) 2020-present Daniel Gatis
License: MIT - See [LICENSES/MIT-rembg.txt](./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](https://github.com/danielgatis) for the excellent [rembg](https://github.com/danielgatis/rembg) library
- Built with β€οΈ using [Streamlit](https://streamlit.io)
---
**Made with π¨ and Python** |