Invert
Redistributes pixel intensities to achieve a more uniform histogram distribution.
ðžïļ Image options and parameters of level
method
Level method applies process called "histogram equalization". Histogram equalization is a technique used in image processing to enhance the contrast and visibility of details in an image by redistributing the pixel intensity values. This process can make details in both dark and bright regions of the image more visible.
Kinds of images compatible with algorithmâ
Image property | What it means | Possible values |
---|---|---|
bitDepth | number of bits per channel | [8,16] |
components | number of components | any |
alpha | is alpha channel allowed | true |
Parameters and default valuesâ
options
Optionsâ
Property | Required | Default value |
---|---|---|
channels | no | - |
gamma | no | 1 |
inputMin | no | 0 |
inputMax | no | image.maxValue |
out | no | - |
outputMin | no | 0 |
outputMax | no | image.maxValue |
Implementation
Here's how level filter is implemented in ImageJS:
Input border values selection: The first step is to choose the range of values that the filter must redistribute.
Output border values selection: Then the range of output values must be chosen. It is necessary to understand in what output limits should lie pixels that belong to the input values set.
Calculation of the values: After getting input and output values each pixel is compared with input values and a ratio is calculated by using formula:
where is a value of a pixel which is within the input borders. If value is outside of input limits it is equal to maximum input value. From there the formula is reciprocated to compute new output value.
gamma
option allows choosing the curve by which points will be connected. It uses Bezier curves to manipulate this shape. The bigger the value, the smoother the connection is.
Setting the values: After calculating it, the filter replaces the original pixel value with this levelled value. This process is repeated for every pixel in the image, as the window moves over the entire image.