品易云推流 关闭
文章详情页
文章 > Python常见问题 > python中如何使用pil

python中如何使用pil

头像

yang

2020-04-11 09:17:532638浏览 · 0收藏 · 0评论

PIL(Python Image Library)是python的第三方图像处理库,但是由于其强大的功能与众多的使用人数,几乎已经被认为是python官方图像处理库了。

python中使用pil的方法:

在命令行使用PIP安装:

pip install Pillow

或在命令行使用easy_install安装:

easy_install Pillow

安装完成后,使用from PIL import Image就引用使用库了。比如:

from PIL import Image
im = Image.open("bride.jpg")
im.rotate(45).show()

示例:

from PIL import Image
from PIL import ImageFilter
im = Image.open("beauty.jpg")
om = im.filter(ImageFilter.BLUR)
om.save("beautyBlur.jpg")

更多Python知识请关注Python视频教程栏目。

关注

关注公众号,随时随地在线学习

本教程部分素材来源于网络,版权问题联系站长!

底部广告图