发布时间:2019-08-06 09:13:35编辑:auto阅读(1885)
了解过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 如何查询版本号
48892
47970
38745
35881
30307
27077
26087
20922
20737
19097
567°
645°
646°
649°
625°
598°
675°
744°
865°
1008°