目录
一、前言
(一)Pillow与PIL简介
1.PIL:PIL(Python Imaging Library)是Python一个强大方便的图像处理库,名气也比较大。不过只支持到Python 2.7。
2.Pillow:由于PIL年久失修,于是一群志愿者在PIL的基础上创建了兼容的版本--Pillow,支持Python 3.x,同时加入了许多新特性。
(二)Pillow安装
1.调出prompt shell,输入pip install pillow;(关于python库的安装方法可见 python安装库的方法)
2.安装完成后,使用代码 from PIL import Image 就可以引用使用库了。
二、实战
(一)将图像变为简笔画风格
直接上代码
from PIL import Image, ImageFilter, ImageOps
img = Image.open("F:\\Pictures\\xx.jpg")
def dodge(a, b