1 | initial version |
The ideal sequence for utilizing the Pillow ImageEnhance filters for Brightness and Contrast is as follows:
Here is an example code snippet:
from PIL import Image, ImageEnhance
# Open the image
img = Image.open('image.jpg')
# Apply the Brightness filter
brightness = ImageEnhance.Brightness(img)
img = brightness.enhance(1.5)
# Apply the Contrast filter
contrast = ImageEnhance.Contrast(img)
img = contrast.enhance(1.2)
# Save the final image
img.save('final_image.jpg')