2015-11-20 45 views
2

我想混合两个图像在一起,但我不断收到错误,其中一个图像在错误的模式。我试图转换这个图像,但我试过的每个模式只是使整个图像变白。 Python中有没有使用PIL模块来找出当前图像模式的方法?获取图像模式PIL Python

Image.blend(img ,im ,0.05) 

错误消息: ValueError: image has wrong mode

+0

什么是完整的错误? –

+0

return im1._new(core.blend(im1.im,im2.im,alpha)) ValueError:image有错误的mod – Chidwack

回答

5

查看的文档中的Image Attributes

im.modestring

Image mode. This is a string specifying the pixel format used by the image. Typical values are '1' , 'L' , 'RGB' , or 'CMYK.' See Concepts for a full list.

Image.convert方法创建,从现有的图像,新Image与给定mode