PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The
ImageEnhance module contains a number of classes that can be used for image enhancement.
ImageEnhance.Brightness() method -
This class can be used to control the brightness of an image. An enhancement factor of 0.0 gives a black image. A factor of 1.0 gives the original image.
Syntax:
obj = ImageEnhance.Brightness(image)
obj.enhance(factor)
First, it is required to create an object of corresponding class in order to enhance image.
Output:
For first image
factor is 2.0 and for
second 5.0
👁 Image
👁 Image
ImageEnhance.Sharpness() method -
This class can be used to adjust the sharpness of an image. An enhancement factor of 0.0 gives a blurred image, a factor of 1.0 gives the original image, and a factor of 2.0 gives a sharpened image.
Syntax:
obj = ImageEnhance.Sharpness(image)
obj.enhance(factor)
First, it is required to create an object of corresponding class in order to enhance image.