GrpC_Identikit/ImageProcessing/remove_bg.py

19 lines
645 B
Python

# Importing Required Modules
from rembg import remove
from PIL import Image
# Store path of the image in the variable input_path
input_path = 'C:/Users/doria/Documents/ECAM/Année 4/IT & Robotics Lab/GrpC_Identikit/ImageProcessing/ImageJPG/Démon.png'
# Store path of the output image in the variable output_path
output_path = 'C:/Users/doria/Documents/ECAM/Année 4/IT & Robotics Lab/GrpC_Identikit/ImageProcessing/Code\Demon.png'
# Processing the image
input = Image.open(input_path)
# Removing the background from the given Image
output = remove(input)
#Saving the image in the given path
output.save(output_path)