python的一些图像操作

from PIL import ImageGrab
im = ImageGrab.grab()
im.save("f:\\T.jpg",'jpeg')
 
直接用pyCharm安装PIL库没成功,于是在
http://www.pythonware.com/products/pil/
直接下载回来安装
 
获取RGB数组
from PIL import Image

im = Image.open('f:\\T.jpg')
pix = im.load()
width = im.size[0]
height = im.size[1]
for x in range(width):
for y in range(height):
r, g, b = pix[x, y]
 
一些图像处理方法参考
http://www.cnblogs.com/txw1958/archive/2012/02/21/2361330.html
http://my.oschina.net/neo600/blog/91170 比较详细的PIL的介绍
 
posted @ 2015-08-08 02:48  elautoctrl  阅读(221)  评论(0编辑  收藏  举报