如何使用PIL获得图片大小? [英] How do I get the picture size with PIL?
本文介绍了如何使用PIL获得图片大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用PIL或任何其他Python库获取图片的大小?
How do I get a size of a pictures sides with PIL or any other Python library?
推荐答案
from PIL import Image
im = Image.open('whatever.png')
width, height = im.size
根据文件。
这篇关于如何使用PIL获得图片大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文