1.PIL简介
PIL:Python Imaging Library,已经是Python平台事实上的图像处理标准库了。PIL功能非常强大,但API却非常简单易用。
2.安装PIL(Python3.x)
pip install pillow
//windows下直接在Dos窗口下载即可,我这里已经安装过了
//python2.x是PIL或者python-imaging
3.操作图像
a、图像缩放
#!/usr/bin/env python
from PIL import Image
# 打开一个jpg图像文件
im = Image.open('cat.jpg')
# 获得图像尺寸:
w, h = im.si