Every time that I’d paste anything to template.png (which is totally transparent) It’ll get this weird black effect that I’ve got no idea where it’s coming from. I’ve tried creating different python file, reinstalling python and Pillow, creating another directory, restarting my computer but nothing seems to solve it. The problem has been ongoing for two days now, it would disappear randomly and come back like that.
I’m on Windows 10 21H1 running Python 3.9.6 and Pillow 8.3.1
base = Image.open('template.png') emoji = Image.open('emoji.png') base.paste(emoji, (0, 0)) base.save('out.png')
(template.png) (emoji.png) (out.png)
Advertisement
Answer
The problem was that I’ve saved the image as single-channel. Thanks to HansHirse