PIL.Image.composite()method creates composite image by blending images using a transparency mask. Here, mask is another image which remains transparent when composite together.
Syntax: PIL.Image.composite(image1, image2, mask)
image1 – The first image.
image2 – The second image. Must have the same mode and size as the first image.
mask – A mask image. This image can have mode “1”, “L”, or “RGBA”, and must have the same size as the other two images.
Showing mask image:
Output: [the composite image]
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course