Contrast

Block Category: Operations

Input Image Requirements: RGB

The Contrast block controls the contrast and brightness of an RGB image by entering specific values or using a slider.

Contrast / Brightness: Together, these values control the contrast and brightness value of every pixel in the image. Specify a Contrast value between 0 and 3, and a Brightness value between 0 and 100.

To better understand the Contrast and Brightness parameters, it is important to remember that two commonly used point processes are multiplication and addition with a constant:

g(x) = αf(x) + β

The parameters α > 0 and β are often called the gain and bias parameters and they control an image’s contrast and brightness, respectively. The source image pixels are represented as f(x) and the output image pixels are represented as g(x). You can write the expression as:

g(i,j) = αf (i,j) + β

where i and j indicate that the pixel is located in the i-th row and j-th column.

Slider: Invokes a slider that lets you dynamically change the contrast and brightness of the image as the simulation progresses. See the description above of the Contrast and Brightness parameters.

Example

In this example, the image’s contrast and brightness are controlled using a slider. With the Gain at 3 and the Bias at 77, the image is lighter and brighter.

ContrastExample2