DEV Community

Cover image for Remove image background with python
isolderea
isolderea

Posted on

Remove image background with python

Remove image background with python with a few simple lines of code

pip install rembg

from rembg import remove
from PIL import Image

input_path ='first.jpg'
output_path = 'result.png'

input = Image.open(input_path)
output = remove ( input)
output.save(output_path)

Write in the comment your result.

Top comments (0)