码迷,mamicode.com
首页 > 编程语言 > 详细

Python缩小图像

时间:2015-12-01 12:19:51      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:

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自带工具查看,处理后的图像尺寸一致,大小不等

Python缩小图像

标签:

原文地址:http://www.cnblogs.com/lynclynn/p/5009411.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!