2024-06-11 17:26:43 发布
网友
我试着把两个图像混合在一起,但我一直得到一个错误,其中一个图像在错误的模式。我试图转换这个图像,但我尝试过的每一种模式都会使整个图像变成白色。Python中是否有方法使用PIL模块来找出当前的图像模式?
Image.blend(img ,im ,0.05)
错误消息: ValueError: image has wrong mode
ValueError: image has wrong mode
请参阅文档中的Image Attributes:
im.mode ⇒ stringImage 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.
im.mode ⇒ string
im.mode
string
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.
'1'
'L'
'RGB'
'CMYK.'
^{}方法从现有图像创建具有给定mode的新Image。
mode
Image
请参阅文档中的Image Attributes:
^{} 方法从现有图像创建具有给定
mode
的新Image
。相关问题 更多 >
编程相关推荐