DEV Community

Cover image for Remove image background with python
isolderea
isolderea

Posted on

1

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)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay