In this Display 101 article, we would like to show you some background of signal processing behind displaying content on LCD modules, and in short, explain gamma correction.
Curiously, we’ll start from human biology. More precisely, the eyes.
The human eye is a complicated organ. For the purpose of this article, it would be worthwhile to know some facts about how it comprehends information. A good example of this is the fact that our eyes are not very sensitive to changes in the light color areas, but they can very easily spot changes in dark environment. It is a trick of evolution that shaped during thousands of years.
The difference of light energy emission between the steps (bars) changes constantly from the left to the right.
Does the second image appear more even?
It sure does.
Again, the answer lies in our eyes. The response of our eyes to light intensity is non-linear. That is why the second image – where the change follows a power-law relationship- is perceived as more even.
Because of this, we need gamma transfer.
Gamma encoding, gamma decoding, compression, expansion – which is which?
You can meet many gamma-related expressions, so let’s clarify some of them:
- Gamma encoding (also gamma compression) is the process of converting values from linear space to gamma.
- Gamma decoding (also gamma expansion) is reverse from the above-mentioned process. So, it’s the process of converting values from space to linear.
See the plot:
red – gamma correction for the display
yellow – linear function of brightness
Individual shades of RGB channels do not change by a fixed value, they are only displayed according to a curve that is a power function.
If the color would be displayed with the yellow (linear) function we would lose many details of the dark areas and wouldn’t be able to realize the differences in a light color.
This operation allows us to adjust the hardware possibilities for the best visual reception.
Should I worry about gamma correction for my project?
We hope that all the physics didn’t turn you away from this topic.
Don’t worry, the gamma correction is already applied in the LCD controller. So, all the perception of the image is already taken care of.