Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference

ID 790148
Date 10/31/2024
Public
Document Table of Contents

Gamma Correction

Gamma correction of images is used to optimize the usage of data type depth when encoding an image by taking advantage of the non-linear manner in which humans perceive light and color. This non-linearity must be compensated to achieve correct color reproduction. To do this, luminance of each of the linear red, green, and blue components is reduced to a non-linear form using an inverse transformation. This process is called gamma correction.

The Intel IPP functions use the following basic equations to convert an RGB image to a gamma-corrected R'G'B' image:

for R,G,B < 0.018

R' = 4.5R

G' = 4.5G

B' = 4.5B

for R,G,B 0.018

R' =1.099R0.45 - 0.099

G' =1.099G0.45 - 0.099

B' =1.099B0.45 - 0.099

Note that the channel intensity values are normalized to fit in the range [0..1]. The gamma value is equal to 1/0.45 = 2.22 in conformity with ITU Rec.709 specification (see [ITU709]).