Skip to content

A Flask-based web application for removing backgrounds from images using Python and the rembg library. This project features a clean UI, efficient image processing, and is easily deployable. Perfect for anyone needing a simple and effective background removal tool.

License

Notifications You must be signed in to change notification settings

fahadelahikhan/Background-Remover-Flask-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Background Remover Flask Python 🖼️

Python Version License

A web application built with Flask that removes backgrounds from images using the rembg library.

📜 About

This project provides a user-friendly web interface for removing backgrounds from images. It leverages the rembg library for efficient background removal and supports multiple image formats. The application is designed to be responsive, accessible, and easy to use.

✨ Features

  • Web-based interface for seamless image uploads
  • Supports JPG, PNG, GIF, and BMP image formats
  • Fast and reliable background removal using rembg
  • Responsive design compatible with desktop and mobile devices
  • Displays processed images with an option to download

Input Image:

Input Image

Processed Image:

Processed Image

🚀 Quick Start

Prerequisites

  • Python 3.8 or higher
  • pip package manager

Installation

  1. Clone the repository:

    git clone https://github.com/fahadelahikhan/Background-Remover-Flask-Python.git
    cd Background-Remover-Flask-Python
  2. Create a virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install required dependencies:

    pip install -r requirements.txt
  4. Run the application:

    python main.py
  5. Open your browser and navigate to http://localhost:4000.

Usage

  • Access the web interface at http://localhost:4000
  • Upload an image by clicking "Choose file" or dragging and dropping
  • Click "Remove Background" to process the image
  • View the processed image and download the result

📖 Project Structure

Background-Remover-Flask-Python/
├── main.py                # Main application code
├── templates/
│   └── index.html         # HTML template for the web interface
├── requirements.txt       # Project dependencies
├── LICENSE.txt            # MIT License file
├── .gitignore             # Git ignore file
├── assets
│   └── input image.jpg
│   └── processed image.jpg
└── README.md              # Project documentation

📋 Requirements

See requirements.txt for a complete list of dependencies.

⚙️ Deployment

For production deployment, use a WSGI server like Gunicorn:

gunicorn -w 4 -b 0.0.0.0:4000 main:create_app

Set the PORT environment variable for custom port configuration:

export PORT=8080  # On Windows: set PORT=8080

🛠️ Troubleshooting

  • Ensure all dependencies are installed correctly.
  • Verify that the uploaded image is in a supported format (JPG, PNG, GIF, BMP).
  • Check the console for error messages if processing fails.

⚖️ License

Distributed under the MIT License. See LICENSE.txt for details.


Note: The quality of background removal depends on the rembg library's capabilities. For best results, use high-quality images with clear foregrounds.

About

A Flask-based web application for removing backgrounds from images using Python and the rembg library. This project features a clean UI, efficient image processing, and is easily deployable. Perfect for anyone needing a simple and effective background removal tool.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published