发布时间:2019-08-06 09:13:35编辑:auto阅读(2109)
了解过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 如何查询版本号
51345
50804
41399
38198
32688
29581
28414
23297
23257
21587
1665°
2397°
2003°
1940°
2270°
1971°
2675°
4474°
4304°
3069°