美文网首页
Python pillow库 (滤镜)

Python pillow库 (滤镜)

作者: 章鱼杂咀 | 来源:发表于2017-09-30 11:52 被阅读0次

    ```python

    from PIL import Image

    im = Image.open('1x.png')

    r,g,b = im.split()

    om = Image.merge('RGB',(b,g,r))

    om.save('1x-bgr.png')

    om = Image.merge('RGB',(r,b,g))

    om.save('1x-rbg.png')

    ```

    ```python

    from PIL import Image

    from PIL import ImageEnhance

    im = Image.open('1x.png')

    om = ImageEnhance.Contrast(im)

    om.enhance(20).save('enhance3.png')

    ```

    ```python

    from PIL import Image

    from PIL import ImageEnhance

    im = Image.open('1x.png')

    om = ImageEnhance.Contrast(im)

    om.enhance(20).save('enhance3.png')

    ```

    ```python

    from PIL import Image

    from PIL import ImageFilter

    im = Image.open('1x.png')

    om = im.filter(ImageFilter.CONTOUR)

    om.save('1x-.png')

    ```

    相关文章

      网友评论

          本文标题:Python pillow库 (滤镜)

          本文链接:https://www.haomeiwen.com/subject/uqpgextx.html