W
W
wz2022-01-10 23:21:40
Python
wz, 2022-01-10 23:21:40

How to remove black background from transparent PIL image?

I need Pillow to not make a transparent image have a black background, how can I do this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lord Legitov, 2022-01-11
@lordcodes

Use PNG image format

S
soremix, 2022-01-11
@SoreMix

bg.paste(icon, mask=icon.convert('RGBA'))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question