Image enhancement involves operations such as changing the contrast, brightness, color balance, or sharpness of an image. Pillow provides an ImageEnhance module, which has functions that can help you perform the earlier mentioned operations.
We will begin with importing the ImageEnhance module using the following code:
>>> from PIL import ImageEnhance
After importing the library, let us see how to use the functions available in the library. First we will see how to change the brightness of an image:
Change brightness of an image: We will use the following code to change the brightness:
>>> enhancer = ImageEnhance.Brightness(img) >>> enhancer.enhance(2).show()
The enhance() function takes a float as an argument, which ...