TIMEX
TIMEX

Reputation: 272164

Using Python's PIL, how do I enhance the contrast/saturation of an image?

Just a simple contrast and saturation enhancement. Nothing fancy.

Upvotes: 13

Views: 23762

Answers (1)

jcomeau_ictx
jcomeau_ictx

Reputation: 38482

Since PIL is dead for the most part. Install the Pillow fork instead, sudo pip install pillow, and use its 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 enhanced)

Upvotes: 29

Related Questions