python Image.blend ValueError: images do not match
from PIL import Image def blend_two_images(): img1 = Image.open( "bridge.png ") img1 = img1.convert('RGBA') img2 = Image.open( "birds.png ") img2 = img2.convert('RGBA') img = Image.blend(img1, img2, 0.3) img.show() img.save( "blend.png") return
提示错误:
Traceback (most recent call last):
File “F:/tmp/caizi.py”, line 192, in
pic_text(filepath,text,setFont,fillColor,filename,direction=None)
File “F:/tmp/caizi.py”, line 77, in pic_text
image = Image.blend(image, canvas,0.5)
File “D:\Python\Python37\lib\site-packages\PIL\Image.py”, line 2974, in blend
return im1._new(core.blend(im1.im, im2.im, alpha))
ValueError: images do not match
解决办法: