python中如何使用pil

发布时间:2022-06-23 09:47:04 人气:261 作者:多测师

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

  python中使用pil的方法:

  在命令行使用PIP安装:

  pip install Pillow

  或在命令行使用easy_install安装:

python中如何使用pil

  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中如何使用pil,希望对大家有所帮助,如果想要了解更多Python相关知识,请关注多测师。https://www.e70w.com/xwzx/


返回列表
在线客服
联系方式

热线电话

17727591462

上班时间

周一到周五

二维码
线