如何使用PIL检测PNG图像是否有透明的alpha通道?
img = Image.open('example.png', 'r')
has_alpha = img.mode == 'RGBA'
通过上面的代码,我们知道PNG图像是否有alpha通道,不是没有,但如何获得alpha值?
我在img.info字典中找不到在PIL's website中描述的“透明”键
我使用的是Ubuntu和zlib1g,zlibc包已经安装好了。
https://stackoverflow.com/questions/1962795
复制相似问题