Let's learn how to modify the image brightness and contrast. First, we will write code to adjust brightness. The
ImageEnhance module makes our job easier by providing
0165_3_12_Before_BRIGHTENING.pngand rename it to
1 import Image 2 import ImageEnhance 3 4 brightness = 3.0 5 peak = Image.open( "C:\\images\\Before_BRIGHTENING.png ") 6 enhancer = ImageEnhance.Brightness(peak) 7 bright = enhancer.enhance(brightness) 8 bright.save( "C:\\images\\BRIGHTENED.png ") 9 bright.show()
Brightness. It takes
Imageinstance as an argument.