Log camera images store colors in a logarithmic scale. The blacks in these images are nearly 0 and the whites are supposed to be infinity. The graphics card and most video codecs store colors in a linear scale but CINELERRA-GG keeps log camera images in their original logarithmic scale when it renders them. This is necessary because the raw image parser can not always decode the proper gamma (γ) values for the images. It also does its processing in 16 bit integers, which takes away a lot of information.

Mathematically, the gamma function is exponential ( output = inputγ) and therefore the inverse of the logarithmic function [ γ = loginput(output)]. Actually the formula used by the CINELERRA-GG plugin is: output = input$\scriptstyle {\frac{{1}}{{\gamma}}}$ which allows for a range of values 0÷1.0. The gamma effect converts the logarithmic colors to linear colors through a gamma value and a maximum value. The gamma value determines how steep the output curve is (i.e. the value of the gamma parameter; for color space Rec709 is 2.4 ( ${\frac{{1}}{{\gamma}}}$ = 0.41...), for sRGB is 2.2 ( ${\frac{{1}}{{\gamma}}}$ = 0.45...), etc.). We use ${\dfrac{{1}}{{\gamma}}}$ because with γ < 1 there is gamma compression of the curve, increasing the output values relative to the linear (see figure 10.44.). With γ > 1 we have gamma expansion, typically used to linearize a compressed gamma curve (Log). The maximum value is where 1.0 in the output corresponds to maximum brightness in the input. It serves to avoid clipped values because it allows you to set the maximum value of the output, 1.0, whenever range adjustment is done (see figure 10.43). It is important to adjust the two parameters accurately in order to avoid undesired and unexpected effects, such as excessive values, unbalanced image, incorrect linearization, etc.

Figure 10.43: settting Maximun to 0.6900
Image gamma01

The gamma effect has two more parameters to simplify gamma correction. The automatic option causes it to calculate max from the histogram of the image. Use this when making a preview of a long list of images since it changes for every image. The use color picker option uses the value currently in the color picker to set the maximum value. Note that every time you pick a color from the compositor window, you need to click on use color picker to apply the new value.

The best use of the gamma is manually monitoring the waveform as shown in figure 10.44.

Figure 10.44: Setting Maximun to 0.6100 and Gamma to 0.3300
Image gamma02

Care must be taken when using gamma correction: if the image carries a specific gamma value, or if it has already been corrected previously (for example automatically in the camera), etc.; then a second application of the gamma leads to excessive and artificial results. Gamma is keyframable.

The CINELERRA-GG Community, 2021