AI Glossary / Computer vision and multimodal AI / Intermediate
Gamma correction
Definition
Gamma correction is a nonlinear adjustment of image values used to account for, encode or modify the relationship between numerical values and light or displayed tone. A simple gamma curve uses a power law, but practical color systems such as sRGB use a specified transfer function rather than one exact power across the entire range.
What it means
An image value of 0.5 does not necessarily represent half as much light as a value of 1.0. Many stored images use nonlinear encoding. The number describes a code value whose relationship to light depends on the color space and processing stage.
The phrase “gamma correction” is used in several ways. It can mean compensating for a display response, converting between encoded and linear-light values, or applying an artistic tone adjustment. These operations should not be conflated simply because they use similarly shaped curves.
For practical work, identify what the values represent before changing them. A visually pleasing adjustment is different from correctly decoding a known transfer function, and applying the same curve twice can produce an unintended result.
How it works
A basic power-law example maps a normalized input x to y = xᵞ. Under this convention, an exponent below 1 raises intermediate values, while an exponent above 1 lowers them. Some interfaces use reciprocal conventions, so a setting labeled “gamma” needs its documented interpretation.
A color-managed pipeline applies the transfer functions appropriate to its input and output. Certain operations, such as physically meaningful light addition, should use linear-light values. The result can then be encoded for storage or display.
Real transfer functions may include linear segments, offsets or other details. sRGB, for example, has a piecewise curve. Numerical range, clipping, bit depth and profile handling all affect whether a correction produces the intended result.
Three practical examples
1. Image compositing: A developer decodes image values to linear light before combining light contributions, then encodes the output for display.
2. Tone adjustment: A photographer uses a midtone curve to change appearance while monitoring highlights and shadows. This is an editing choice rather than proof of colourimetric correctness.
3. Software testing: A team investigates why the same image looks too dark in one preview and discovers that a transfer-function conversion is missing or duplicated.
Think of it this way
Think of a ruler with unevenly spaced numerical labels. Before adding physical lengths, you need to translate the labels into actual distances. Afterwards, you can label the result using the chosen ruler again.
The analogy explains encoded values but not visual perception completely. Display behavior and color management involve more than one curve, and an artistic gamma adjustment may deliberately change the image rather than preserve a physical quantity.
Worked example
Using the explicit curve y = xᵞ, take x = 0.25 and γ = 0.5. The output is the square root of 0.25, or 0.5. With γ = 2, the output is 0.0625. These opposite effects show why the exponent convention must be stated.
Now consider sRGB decoding. An encoded value of 0.5 corresponds to approximately 0.214 in linear light under the standard sRGB transfer function, not 0.5. Thus averaging encoded black and white gives a code value of 0.5, while averaging their linear-light values gives 0.5 linear, which encodes to approximately 0.735.
Neither arithmetic description should be hidden behind the word “average.” The correct operation depends on what the workflow intends to preserve or produce.
Illustrative case study
Fictional case: Elm Design notices dark-looking transitions where a graphics tool blends bright shapes over a dark background. The developer inspects the color pipeline and finds that the blend operates on encoded values while the intended operation is linear-light mixing.
The team tests a corrected conversion sequence using simple patches and then reviews actual designs. It keeps artistic tone controls separate from the technical decoding and encoding stages so users do not accidentally compensate for one error with another. The case illustrates a pipeline distinction, not a universal claim that every artistic blend must look a particular way.
Common misconceptions and mistakes
Gamma correction is not synonymous with exposure adjustment. Multiplying linear-light values and applying a nonlinear curve are different operations.
sRGB is not exactly a pure 2.2 power law. Approximations may be useful for intuition but should not replace its specified conversion when accuracy matters.
A larger “gamma” setting does not have a universal interface meaning. Some tools use an exponent and others its reciprocal or another parameterization.
A correct curve cannot repair missing information caused by clipping or severe quantization. Nor does changing gamma alone establish correct color primaries, white point or complete display calibration.
Business use
Gamma handling affects image previews, compositing, rendering and measurement pipelines. A small misunderstanding can produce systematic differences that are difficult to diagnose by eye alone.
Document color spaces and transfer functions at each stage. Test known values, not only attractive photographs, and distinguish technical conversions from user-facing creative adjustments. For image analysis, determine whether the model or measurement expects encoded or linear data before changing the input convention.
People also ask
Does gamma correction always brighten an image?
No. The effect depends on the curve, its direction and the parameter convention.
Is decoding gamma the same as removing all color management?
No. Transfer-function decoding is one part of color handling; primaries and white point still matter.
Can gamma correction restore clipped highlights?
No. It can redistribute recorded values, but it cannot recover different scene intensities that were all clipped to the same maximum.
Check your understanding
A pipeline decodes an already linear-light image as though it were sRGB-encoded. Is this a harmless extra correction?
Answer: No. It applies the wrong nonlinear transformation and changes the values incorrectly. The pipeline must know each image's representation rather than assuming every array needs the same conversion.
Related terms
- Gamma encoding
- Transfer function
- Linear light
- Tone curve
- sRGB
- colour management
- exposure
Learn next
Plot y = xᵞ for a few explicitly stated exponents and compare it with the sRGB transfer function. Then calculate a simple blend in encoded and linear-light values. Trace a real image pipeline from input profile to display so every conversion has a clear purpose.
More in Computer vision and multimodal AI
- Gabor filter - A Gabor filter is a filter formed by combining a sinusoidal pattern with a Gaussian envelope.
- Gabor transform - The Gabor transform is a time-frequency representation obtained by applying a Fourier transform to a signal viewed through a shifted Gaussian window.
- Galerkin approximation - A Galerkin approximation represents an unknown solution using a finite set of basis functions and chooses their coefficients so that the equation's residual...
- Gaussian blur - Gaussian blur smooths an image by replacing each pixel with a weighted combination of neighboring values, using weights shaped like a Gaussian distribution.
- Generalized Hough transform - The generalized Hough transform is a shape-detection method that lets image features vote for possible locations and, in suitable variants, orientations and...
- Geodesic distance - Geodesic distance is the length of a shortest permitted path between two points within a specified surface or domain.
Sources
Primary specification resources: W3C, “Specification of sRGB,” https://www.w3.org/Graphics/Color/srgb.pdf ; CSS Color Module Level 4, https://www.w3.org/TR/2024/CRD-css-color-4-20240213/ . Relevant returned transfer-function definitions were reviewed. The power-law and blending calculations are original illustrations; the entry does not claim that a single gamma adjustment performs complete colour calibration.
Previous: Game tree Next: Gamma distribution