• 技术文章 >常见问题 >Python常见问题

    python中如何使用pil

    yangyang2020-04-11 09:17:53原创2736

    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视频教程栏目。

    专题推荐:python
    上一篇:python合并多个excel文件 下一篇:python中iter函数怎么用

    相关文章推荐

    • python中怎么交换列的顺序• python系统命令乱码如何解决• python判断是否完数• python列表是否允许重复

    全部评论我要评论

    © 2021 Python学习网 苏ICP备2021003149号-1

  • 取消发布评论
  • 

    Python学习网