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:\Python\Code\me.jpg")
print img.format,img.size,img.mode

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

相关

1.PIL资料

http://effbot.org/imagingbook/

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

posted @ 2015-12-01 10:46  南湖鹄  阅读(532)  评论(0编辑  收藏  举报