Python读取图片尺寸.图片格式 需要用到PIL模块,使用pip安装Pillow.Pillow是从PIL fork过来的Python 图片库. from PIL import Image im = Image.open(filename)#返回一个Image对象 print('宽:%d,高:%d'%(im.size[0],im.size[1])) Image类的属性 PIL.Image.format 图片生成时的原格式,不是以文件后缀名为依据. 类型: string or None PIL.I…