I wanted to merge three images using PIL in python. I have spent a while trying to get three images to merge, but I am able to merge two.
I am aware of the question that was asked about merging two images (How to merge a transparent png image with another image using PIL)
Here is my code:
def addImageList(imageNameList):
((Image.open(imageNameList[0]).paste(Image.open(imageNameList[1]), (0, 0),
Image.open(imageNameList[1]))).paste(Image.open(imageNameList[2]), (0, 0),
Image.open(imageNameList[2]))).show()
When this runs, I get the error:
AttributeError: 'NoneType' object has no attribute 'paste'
I have tried merging only two of the pictures, and that worked well.