3 identifier: movit.lift_gamma_gain
4 title: Lift, Gamma, and Gain (GLSL)
7 creator: Steinar H. Gunderson
13 A simple lift/gamma/gain effect, used for color grading.
15 Very roughly speaking, lift=shadows, gamma=midtones and gain=highlights,
16 although all parameters affect the entire curve. Mathematically speaking,
17 it is a bit unusual to look at gamma as a color, but it works pretty well
19 The classic formula is: output = (gain * (x + lift * (1-x)))^(1/gamma).
20 The lift is actually a case where we actually would _not_ want linear light;
21 since black by definition becomes equal to the lift color, we want lift to
22 be pretty close to black, but in linear light that means lift affects the
23 rest of the curve relatively little. Thus, we actually convert to gamma 2.2
24 before lift, and then back again afterwards. (Gain and gamma are,
25 up to constants, commutative with the de-gamma operation.)