Beginning with Pillow, the PIL Fork (Python Imaging Library)

Article index:

6 – Image Processing Operations

Pillow image processing operations are available via the ImageOps module. ImageOps exposes image processing functions such as crop(), colorize(), flip(), grayscale(), invert(), mirror(), solarize(), or posterize().

from PIL import Image
from PIL import ImageOps

im = ImageOps.solarize(im0, 128)  
#im = ImageOps.posterize(im0, 1)  

The full demo is available in moon3d/gl-210-python-pil-pillow/pillow_image_ops.xml. Just load it in GLSL Hacker and you should get:

GLSL Hacker, Pillow (PIL fork) image processing operations, solarize, Python
ImageOps.solarize()





Article index: