Using Python PIL, how to increase contrast / saturation of the image?

Simple enhancement of contrast and saturation. Nothing unusual.

+4
source share
1 answer

Since PIL is dead for the most part. Instead, install the pillow plug, sudo pip install pillow and use the ImageEnhance module http://pillow.readthedocs.org/en/3.0.x/reference/ImageEnhance.html

 >>> from PIL import Image, ImageEnhance >>> image = Image.open('downloads/jcfeb2011.jpg') >>> contrast = ImageEnhance.Contrast(image) >>> image.show() 

(unenhanced)

 >>> contrast.enhance(2).show() 

(contrast enhancement)

+14
source

All Articles