My simple Python script for removing the background of an image using Python.
- Using CLI
- Using the UI
- 📁 Create an
image
folder where you can store the image you want to remove the background. - 📝 In the same directory, create a Python file
removebg.py
and copy the code. - 📦 Install the above core packages.
- 📂 Create an
outputImage
folder. ▶️ Run the code. (Ensure that the name of the image and directory is accurate.)- ⏳ Wait for the execution; sometimes it will take a few seconds or more depending on the device used.
- 🎉 Enjoy...
- Run the code
- Very simple UI and easy to understand.
- have a descriptive buttons functionalities so easy to use.
Here is an example of how to use the script:
from rembg import remove
from PIL import Image
input_path = 'image/input.jpg'
output_path = 'outputImage/output.png'
input_image = Image.open(input_path)
output_image = remove(input_image)
output_image.save(output_path)
This project is licensed under the MIT License - see the LICENSE file for details.
If you have suggestions for improving this script, please open an issue or submit a pull request.
For any inquiries, please contact christian.barbosa05222001@gmail.com.