[ACCEPTED]-Using Python's PIL, how do I enhance the contrast/saturation of an image?-python-imaging-library
Accepted answer
Since PIL is dead for the most part. Install 2 the Pillow fork instead, sudo pip install pillow
, and use its ImageEnhance 1 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()
>>> contrast.enhance(2).show()
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.