

Image moduleImageChops (“channel operations”) moduleImageCms moduleImageColor moduleImageDraw moduleImageEnhance moduleImageFile moduleImageFilter moduleImageFont moduleImageGrab moduleImageMath moduleImageMorph moduleImageOps moduleImagePalette moduleImagePath moduleImageQt moduleImageSequence moduleImageShow moduleImageStat moduleImageText moduleImageTk moduleImageTransform moduleImageWin module (Windows-only)ExifTags moduleTiffTags moduleJpegPresets modulePSDraw modulePixelAccess classfeatures moduleImageEnhance module¶TheImageEnhance module contains a number of classes that can be usedfor image enhancement.
fromPILimportImageEnhanceenhancer=ImageEnhance.Sharpness(image)foriinrange(8):factor=i/4.0enhancer.enhance(factor).show(f"Sharpness{factor:f}")
Also see theenhancer.py demo program in theScripts/directory.
All enhancement classes implement a common interface, containing a singlemethod:
Adjust image color balance.
This class can be used to adjust the colour balance of an image, in amanner similar to the controls on a colour TV set. Anenhancement factor of 0.0 gives a black andwhite image. A factor of 1.0 gives the original image.
Adjust image contrast.
This class can be used to control the contrast of an image, similar to thecontrast control on a TV set. Anenhancement factor of 0.0 gives a solid grayimage, a factor of 1.0 gives the original image, and greater valuesincrease the contrast of the image.
Adjust image brightness.
This class can be used to control the brightness of an image. Anenhancement factor of 0.0 gives a black image,a factor of 1.0 gives the original image, and greater values increase thebrightness of the image.
Adjust image sharpness.
This class can be used to adjust the sharpness of an image. Anenhancement factor of 0.0 gives a blurredimage, a factor of 1.0 gives the original image, and a factor of 2.0 givesa sharpened image.