python中如何使用pil
PIL(Python Image Library)是python的第三方图像处理库,但是由于其强大的功能与众多的使用人数,几乎已经被认为是python官方图像处理库了。
python中使用pil的方法:
在命令行使用PIP安装:
pip install Pillow
或在命令行使用easy_install安装:
easy_install Pillow
安装完成后,使用from PIL import Image就引用使用库了。比如:
from PIL import Imageim = Image.open("bride.jpg")
im.rotate(45).show()
示例:
from PIL import Imagefrom PIL import ImageFilter
im = Image.open("beauty.jpg")
om = im.filter(ImageFilter.BLUR)
om.save("beautyBlur.jpg")
更多Python知识请关注云海天Python教程栏目。
以上是 python中如何使用pil 的全部内容, 来源链接: utcz.com/z/527098.html