Python pillow库 (滤镜)

Python pillow库 (滤镜)_第1张图片

```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 pillow库 (滤镜)_第2张图片
Python pillow库 (滤镜)_第3张图片
Python pillow库 (滤镜)_第4张图片


```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 pillow库 (滤镜)_第5张图片

```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库 (滤镜))