Paste RBG image without its background onto another picture (PIL)

Viewed 40
1 Answers

You can use alpha composite in PIL to paste an image and keep the alpha channels for transparency.

stats = Image.open("stats.png")
skin = Image.open("skin.png")
skin = skin.resize((148, 355))
stats.alpha_composite(skin,(42,232))

stats.save("temp.png")

Resulting image: enter image description here

Related