Image.levelize

applies the reversed level operation to just the channels specified. It compresses the full range of color values, so that they lie between the given black and white points. Gamma is applied before the values are mapped.

It can be used for example de-contrast a greyscale image to the exact levels specified. Or by using specific levels for each channel of an image you can convert a gray-scale image to any linear color gradient, according to those levels.

Parameters

blackPoint
Type: Quantum

Specifies the darkest color in the image.

whitePoint
Type: Quantum

Specifies the lightest color in the image.

gamma
Type: double

Specifies the gamma correction to apply to the image.

channel

The channels to level.

Meta