一、PIL
PIL
全称是:Python Imaging Library。
PIL
是一个强大的、方便的python图像处理库,功能非常强大,曾经一度被认为是python平台事实上的图像处理标准库,不过Python 2.7以后不再支持。
PIL
官方网站:
http://pythonware.com/products/pil/
二、Pillow
Pillow
是基于PIL
模块fork的一个派生分支,但如今已经发展成为比PIL
本身更具活力的图像处理库。
Pillow
友好支持python3,目前pypi
上最新版本是Pillow 7.2.0
。
Pillow
官方文档地址:
https://pillow.readthedocs.io/en/stable/
python3安装pillow
:
pip install Pillow
简单使用Pillow
:
# 从Pillow导入Image模块
from PIL import Image
# 打开图片bride.jpg
im = Image.open("bride.jpg")
# 显示图片
im.rotate(45).show()
到此,PIL
和Pillow
介绍完毕!
END.