Image.level

Adjusts the levels of an image by scaling the colors falling between specified white and black points to the full available quantum range. The parameters provided represent the black, mid, and white points. Colors darker than the black point are set to zero. Colors brighter than the white point are set to the maximum quantum value.

It is typically used to improve image contrast, or to provide a controlled linear threshold for the image. If the black and white points are set to the minimum and maximum values found in the image, the image can be normalized. or by swapping black and white values, negate the image.

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