Fourth, the display of light intensity
(1) The allocation of intensity level
Does anyone think about such a problem, that is, why is the brightness rating in the RGB model we often use linear changes? How does the brightness level are allocated to RGB (0,0,0,0) to RGB (255, 255, 255)? Below we will explore these issues in the future.
For one pixel represented by the RGB three components, the display card will be converted to the electrical signal by D / A, and then the display is finally output to the screen, then let's first see how we allocate the brightness level to 0 to 1 The range is within the range. First, we have the same feeling of light intensity and sound intensity, that is, the logarithm is changed. This means that the difference between the two intensities we feel is the same if the ratio between the two intensities and the two intensity is the same. Therefore, in order to display N 1 we feel the brightness level of linear changes, the level of the display on the display must be distributed to obtain linear changes.
I1 / I0 = I2 / I1 = ... = IN / IN-1 = r
We assume that the lowest level I0 can be displayed on the display, the highest level is in, and any intermediate strength IK is:
IK = rki0
Assume that the highest intensity IN is 1, for specific I0 and N, we can get the ratio R:
R = (1 / i0) 1 / n
Usually, the display I0 we use is between 0.005 to 0.025, and for each pixel gray of 8 bits (n = 255) I0 = 0.01, the ratio R = 1.0182 of the adjacent intensity level, the approximate value of 256 intensity levels is 0.0100, 0.0102, 0.0104, 0.0106, 0.0109, ..., 0.9821 and 1.0000.
For color systems, we can set the intensity level with the above methods for the three components of R, G, and B. In this way, we get the RGB model we usually use a light intensity on line-shaped change.
(2) GAMMA correction
The display we use is a non-linear device, and the display of the display of the monitor is proportional to the proportion, that is, the light intensity value of a set of linear changes produced by the light model, displayed on the display to become Nonlinear. The light intensity of pixels (128, 128, 128) of RGB color is half of (255, 255, 255), but it is not true on the display, please see the figure below:
The background of this panel is the correct (128, 128, 128) color block, the intermediate color block is a color block filled with (128, 128, 128). If the monitor is linear, the middle color block is far from the background color, but due to the nonlinearity of the display, it is possible to faint color blocks in the middle due to the nonlinearity of the display. The figure below is the response curve of the display, and the intensity display is actually changed according to the figure.
We describe the display response curve with the following function:
I = AVG
I is the light intensity, V is voltage, parameters A, and G determine the properties of the display. This allows for a specific intensity value I, we can calculate the correct voltage value (i.e., pixel value):
V = (1 / a) 1 / g
This calculation is called the GAMMA correction of the light intensity, and the general display G value is typically between 2 and 3, which is related to the particular display. The picture below is a picture after Gamma (G value 2), it seems to be much better, if we choose a more accurate Gamma value, you can make the middle color block in the background color.