Skip to content

This is a Flask-based web application that allows users to remove the background from images. The app utilizes the rembg library, combined with the power of Pillow (PIL) for image processing. Users can upload images in formats like PNG, JPEG, and JPG, and the app will return the image with the background removed.

License

Notifications You must be signed in to change notification settings

vauzher/background-removal-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Background Removal App

This is a Flask-based web application that allows users to upload images and remove their backgrounds using the rembg library. The app provides a simple interface for uploading images and returns a Base64-encoded version of the image with the background removed. It supports common image formats like PNG, JPG, and JPEG.

Features

  • Flask Backend: A lightweight web server built with Flask to handle file uploads and image processing requests.
  • rembg Library: Utilizes the powerful rembg tool for background removal.
  • Pillow (PIL): Used for image handling and manipulation.
  • Base64 Image Encoding: After processing, the app returns the image in Base64 format, making it easy to embed in HTML or share over APIs.
  • Frontend Interface: A minimal HTML, CSS, JS webpage where users can upload images for background removal.

Project Structure

background-removal-app/
│
├── app.py                    # Main Flask application
├── templates/                 # Frontend HTML templates
│   └── upload.html            # HTML template for image upload
├── uploads/                   # Directory for storing uploaded files (if needed)
├── requirements.txt           # List of dependencies
├── README.md                  # Project description (this file)
└── .gitignore                 # Git ignore file

Project Screenshots

  1. Start alt text

  2. Uploading a Photo alt text

  3. In Process alt text

  4. Removed Background alt text

Installation

Prerequisites

  • Python 3.x
  • pip (Python package installer)

Steps

  1. Clone the repository:

    git clone https://github.com/vauzher/background-removal-app.git
    cd background-removal-app
  2. Create a virtual environment (optional but recommended):

    python -m venv venv
    source venv/bin/activate  # For Linux/Mac
    # .\venv\Scripts\activate  # For Windows
  3. Install the dependencies:

    pip install -r requirements.txt
  4. Run the Flask app:

    python app.py
  5. Access the app in your browser at http://127.0.0.1:5000/.

Usage

  1. Open your browser and go to http://127.0.0.1:5000/.
  2. Use the upload form on the page to select an image (PNG, JPG, or JPEG).
  3. After submitting the image, the app will process the image and remove the background.
  4. The result will be returned as a Base64-encoded string, which you can use in web applications.

Contributing

Contributions are welcome! If you have any suggestions or improvements, feel free to fork the repository and submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

This is a Flask-based web application that allows users to remove the background from images. The app utilizes the rembg library, combined with the power of Pillow (PIL) for image processing. Users can upload images in formats like PNG, JPEG, and JPG, and the app will return the image with the background removed.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published