Calculate pure gamma encoding or decoding, solve the gamma exponent, and convert exact sRGB encoded values to linear light in normalized or 8-bit units.

One color channel at a time. Pure gamma and the standard piecewise sRGB transfer are different models.

Use the selected value scale.

Gamma Correction Formula

In the “Pure Gamma” (power-law) model, gamma decoding (linearization) and gamma encoding are related by the following equations.

O & = Iγ \ I & = O1 / γ

Variables:

  • O is the linear-light (decoded) output value (0 to 1)
  • I is the gamma-encoded (nonlinear) input value (0 to 1)
  • γ (gamma) is the gamma exponent (γ > 0)

To decode/linearize a gamma-encoded value, raise it to the power of γ (O = I^γ). To encode a linear-light value, raise it to the power of 1/γ (I = O^(1/γ)). Note: real standards such as sRGB are not a pure power law across the whole range; choose sRGB encoded to linear or Linear to sRGB encoded in Solve for. These modes use the standard piecewise transfer functions.

What is Gamma Correction?

Gamma correction is a nonlinear operation used to encode or decode luminance (or tristimulus) values in video and still-image systems. In practice, it is used to convert between linear light (where values are proportional to physical light intensity) and a nonlinear signal representation designed to match display behavior and human visual perception. Depending on direction, gamma correction may mean encoding (applying a 1/γ power) or decoding/linearization (applying a γ power).

How to Calculate Gamma Correction?

The following steps outline how to calculate a gamma conversion using the pure power-law model.


  1. Decide whether you are decoding/linearizing (O = I^γ) or encoding (I = O^(1/γ)).
  2. Determine the normalized value(s) (I and/or O), each between 0 and 1.
  3. Determine the gamma exponent (γ), which should be greater than 0.
  4. Use the appropriate formula to calculate the unknown value.
  5. Enter the known values into the calculator above to confirm your result.

Example Problem : 

Use the following variables as an example problem to test your knowledge.

Input value (I) = 0.5

Gamma (γ) = 2.2

Using the decoding/linearization formula O = I^γ, the output value (O) is calculated as:

O = 0.5^2.2 ≈ 0.218