python 从网络URL读取图片并直接处理的代码

如下代码段是关于python 从网络URL读取图片并直接处理的代码。


import urllib2
import Image
import cStringIO
def ImageScale(url,size):
file = cStringIO.StringIO(urllib2.urlopen(url).read())
img = Image.open(file)
img.show()

猜你喜欢

转载自blog.51cto.com/14142860/2347335