A beautiful and intuitive web-based GUI for the rembg Python library. Remove image backgrounds and replace them with solid colors or custom images, similar to remove.bg.
- π¨ Remove Background: Instantly remove backgrounds from images using AI
- π Solid Color Background: Add any solid color as background with a color picker
- πΌοΈ Custom Image Background: Upload and use custom images as backgrounds
- β¬οΈ Download Options: Download both transparent and final images
- π± Responsive Design: Works on desktop, tablet, and mobile devices
- π― Drag & Drop: Easy drag and drop interface for image upload
- β‘ Fast Processing: Powered by rembg for quick background removal
The application features:
- Clean, modern interface inspired by remove.bg
- Side-by-side comparison of original and processed images
- Preset color options for quick background selection
- Real-time preview of background changes
- Python 3.8 or higher
- pip (Python package manager)
- Clone the repository:
git clone https://github.com/redevil1/rembg-gui.git
cd rembg-gui- Create and activate a virtual environment (recommended):
On Linux/macOS:
python3 -m venv venv
source venv/bin/activateOn Windows:
python -m venv venv
venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Run the application:
python app.py- Open your browser and navigate to:
http://localhost:5000
- Click "Choose Image" or drag and drop an image onto the upload area
- Wait for the background to be removed automatically
- Download the transparent image using "Download Transparent" button
For production use, it's recommended to:
- Disable debug mode by setting
debug=Falseinapp.py, or - Use a production WSGI server like gunicorn:
pip install gunicorn
gunicorn -w 4 -b 0.0.0.0:5000 app:app- Click "Choose Image" or drag and drop an image onto the upload area
- Wait for the background to be removed automatically
- Download the transparent image using "Download Transparent" button
- After background removal, click on "Solid Color" tab
- Choose a color using the color picker or select from preset colors
- Click "Apply Color Background"
- Download the final image
- After background removal, click on "Image" tab
- Click "Choose Background Image" and select an image
- Click "Apply Image Background"
- Download the final image
- Backend: Flask (Python web framework)
- Background Removal: rembg (AI-powered background removal)
- Image Processing: Pillow (PIL)
- Frontend: HTML5, CSS3, JavaScript (Vanilla)
- Design: Modern gradient design with responsive layout
Remove background from an uploaded image.
Request:
- Form data with
imagefile
Response:
{
"success": true,
"image": "data:image/png;base64,..."
}Add a background (color or image) to a transparent image.
Request:
{
"foreground": "data:image/png;base64,...",
"backgroundColor": "#ffffff"
}OR
{
"foreground": "data:image/png;base64,...",
"backgroundImage": "data:image/png;base64,..."
}Response:
{
"success": true,
"image": "data:image/png;base64,..."
}rembg-gui/
βββ app.py # Flask backend application
βββ requirements.txt # Python dependencies
βββ templates/
β βββ index.html # Main HTML template
βββ static/
β βββ css/
β β βββ style.css # Styling
β βββ js/
β βββ script.js # Frontend logic
βββ uploads/ # Temporary upload directory
βββ outputs/ # Temporary output directory
- Flask==3.0.0
- flask-cors==4.0.0
- rembg==2.0.57
- Pillow==10.1.0
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions, please open an issue on GitHub.



