当前位置: 首页 > 图灵资讯 > 行业资讯> python中如何使用pil

python中如何使用pil

发布时间:2026-05-14 16:02:59

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

python中使用pil的方法:

PIP安装用于命令行:

pipinstallPillow

或在命令行中使用easy_install安装:

easy_installPillow

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

fromPILimportImage
im=Image.open("bride.jpg")
im.rotate(45).show()

示例:

fromPILimportImage
fromPILimportImageFilter
im=Image.open("beauty.jpg")
om=im.filter(ImageFilter.BLUR)
om.save("beautyBlur.jpg")

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

相关文章

用python如何判断字符的大小写

用python如何判断字符的大小写

2026-05-29
python如何插入音乐

python如何插入音乐

2026-05-17
python如何查找列表元素对应的索引

python如何查找列表元素对应的索引

2026-05-17
postgresql如何备份数据库

postgresql如何备份数据库

2026-05-17
python中怎么获取密码输入次数

python中怎么获取密码输入次数

2026-05-17
python中怎么安装插件

python中怎么安装插件

2026-05-17