Skip to content

Munya-Marinda/python-background-remover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Background Removal with rembg | Just For Fun 🤗

This repository contains a Python script for removing backgrounds from images using the rembg library. It provides a simple solution for automatically removing backgrounds from a collection of images.

Installation

Before running the script, make sure you have Python installed on your system. You can install the required Python modules using pip:

pip install rembg pillow

Usage

  1. Clone the repository to your local machine:
git clone https://github.com/your-username/your-repo.git
cd your-repo
  1. Place your images in the inputs directory. These should be JPG files with the backgrounds you want to remove.

  2. Run the Python script remove_background.py:

python remove_background.py
  1. After the script finishes executing, the images with removed backgrounds will be saved in the no-background directory as PNG files.

Example

Suppose you have a collection of images named banana.jpg, berries.jpg, empty-globe.jpg, and icecream-cone.jpg in the inputs directory. Running the script will remove the backgrounds from these images and save the resulting images in the no-background directory.

Notes

  • Make sure to adjust the file paths in the script if your directory structure differs.
  • The rembg library utilizes AI-based algorithms for background removal, providing accurate results.
  • Feel free to modify the script or integrate it into your projects as needed.

For more information on the rembg library, refer to the official documentation: rembg Documentation

For any questions or issues, please open an issue on GitHub.

Happy background removal! 🖼️✂️

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages