发布时间:2019-08-06 09:13:35编辑:auto阅读(2071)
了解过Pillow的都知道,Pillow是一个非常强大的图片处理器,这篇文章主要记录一下Pillow对图片信息的获取:
pip install pillow
import os
from PIL import Image
path = os.path.join(os.getcwd(),"23.png")
img = Image.open(path)
print img.format # PNG
print img.size # (3500, 3500)
path = "http://h.hiphotos.baidu.com/image/pic/item/c8ea15ce36d3d5397966ba5b3187e950342ab0cb.jpg"
file = urllib2.urlopen(path)
tmpIm = cStringIO.StringIO(file.read())
img = Image.open(tmpIm)
print img.format # JPEG
print img.size # (801, 1200)
上一篇: python3之DNS处理模块dnspy
下一篇: Python 如何查询版本号
50963
50343
40960
37828
32292
29183
28072
22899
22862
21194
1055°
1731°
1419°
1352°
1617°
1443°
2101°
3643°
3569°
2514°