python中如何使用pil
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视频教程栏目。
本网站文章仅供交流学习 ,不作为商用, 版权归属原作者,部分文章推送时未能及时与原作者取得联系,若来源标注错误或侵犯到您的权益烦请告知,我们将立即删除.