ImageOps module contains a collection of functions that perform various image operations in a single call.
Operations fall into several groups:
- Image resizing - expand, crop, scale, pad, fit
- Image transformation - flip, mirror, exif_transpose
- Image deform - deform
- Colour effects - colorize, grayscale, invert, posterize, solarize
- Colour adjustment - autocontrast, equalize
This module is described as "experimental" in the Pillow documentation. They are actually pretty reliable, although they should only be used with 8 bit RGB and greyscale images. There are other ways of performing these operations using standard functions, but that would usually require multiple function calls, so this module is worth knowing about.
We will use an image called carousel-small.jpg to illustrate these functions: