from PIL import Image, ImageOps # Open image file img = Image.open('image.jpg') # Normalize brightness normalized_img = ImageOps.autocontrast(img) # Display normalized image normalized_img.show()
from PIL import Image, ImageOps # Open image file img = Image.open('image.jpg') # Normalize contrast normalized_img = ImageOps.equalize(img) # Display normalized image normalized_img.show()In both examples, we use the ImageOps module from the PIL library to normalize the image options. The first example normalizes the brightness using the autocontrast() method, and the second example normalizes the contrast using the equalize() method. Both examples display the normalized image using the show() method. Overall, the Image _normalize_options module is a useful tool for adjusting image options and enhancing image quality.