image-processingpython-imaging-library

PIllow Image.paste v.s composite v.s. alpha_composite v.s. blend, what's the difference?


Newbie in image processing. I'm confused with these methods when merging two images with Pillow:

PIL.Image.Image

Could anyone provide a quick explanation? Or where could I grab the related background knowledge?


Solution

  • I see it like this:


    Put another way, blend is no alpha/transparency channel and a fixed proportion of each input image present throughout the output image.

    paste is a single alpha channel that can vary across the image.

    alpha_composite is two alpha channels that can both vary across the image.