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 Quantum

Specifies the darkest color in the image.

whitePoint Quantum

Specifies the lightest color in the image.

gamma double

Specifies the gamma correction to apply to the image.

channel ChannelType

The channels to level.

Meta