Python通过 PIL 模块的 Image 库操作图片

发表于 2020-06-14 17:09:04
阅读 23

介绍

介绍

今天我们来学习使用 Python 通过 PIL 模块的 Image 库操作图片的方法

PIL 是 Python Image Library 的简称,就是 Python 图像库的意思

教程

下载PIL模块

PIL 库下载地址

http://www.pythonware.com/products/pil/

我们选择的版本

wget http://effbot.org/downloads/Imaging-1.1.7.tar.gz

安装PIL模块

暂时不支持 Python3,我们还是用 Python2 来安装吧

tar -xzvf Imaging-1.1.7.tar.gz
cd Imaging-1.1.7
python setup.py build
python setup.py instal

安装matplotlib模块

我们使用 pip3 安装 matplotlib 模块

pip3 install matplotlib