Python缩小图像

LyncLynn用途:

缩小图像

# -*- coding: UTF-8 -*-

#Version: V1.0
#Author:lynclynn
#CreateDate:20151201
#UpdateDate:
#Description:Change the picture 

from PIL import Image

#打开源图像
img= Image.open("E:PythonCodeme.jpg")
print img.format,img.size,img.mode

#缩小图像,保存
new_img=img.resize((731,1187),Image.BILINEAR)
new_img.save("E:PythonCode1me1.jpg")
print new_img.format,new_img.size,new_img.mode

相关

1.PIL资料

http://effbot.org/imagingbook/

2.用Windows自带工具查看,处理后的图像尺寸一致,大小不等

三年有成,问苍茫~
原文地址:https://www.cnblogs.com/lynclynn/p/5009411.html