Learn Before
Concept

Advanced Enhancement

The ImageEnhance module provides its own classes and functions that allows the user to adjust contrast, brightness, color balance, and sharpness. For all four functions, an enhancement factor of 1.0 gives the original image, and a factor of 0.0 gives a black/white/blurred image.

For instance, to vary the sharpness of an image, use:

from PIL import ImageEnhance enhancer = ImageEnhance.Sharpness(image) for i in range(8): factor = i / 4.0 enhancer.enhance(factor).show(f"Sharpness {factor:f}")

0

1

Updated 2021-07-13

Tags

Python Programming Language

Data Science

Related