Gamma Correction Converter

The Gamma Correction Converter converts pixel values between linear and gamma-encoded spaces to correct perceived display brightness.

Gamma Correction Calculator Convert between linear light and gamma-encoded values (and compute gamma / required input) for images and video workflows.
Mode Pick what you want to compute.
Gamma (γ) Typical values: 2.20 (sRGB-ish), 2.40 (BT.1886 reference).
Linear value (L) Normalized linear light in [0, 1].
Gamma-encoded value (E) Normalized encoded signal in [0, 1].
Output scale Also shows the corresponding integer code value.
Clamp inputs to 0–1 Prevents invalid values from breaking the math.
Example Presets

Report an issue

Spotted a wrong result, broken field, or typo? Tell us below and we’ll fix it fast.


About the Gamma Correction Converter

Gamma correction is the process of applying an exponent to relate signal code values to perceived brightness. A gamma curve models how displays produce light and how humans perceive it. This converter lets you move between linear luminance (proportional to light) and non-linear code values (what files and signals store). It helps match images to displays, match encodings between systems, and avoid dull or washed-out output.

The tool supports forward gamma (linear to encoded) and inverse gamma (encoded to linear). It includes presets for sRGB, Rec.709 OETF, and BT.1886 EOTF, plus a custom gamma option. You can choose input scaling (0–1 or 0–255), bit depth, and rounding mode. The interface shows the numerical output and includes notes on the assumptions used.

Gamma Correction Formulas & Derivations

Gamma is an exponent that links linear light to signal values. A simple power-law model uses a single exponent. Real standards add offsets and knees to better fit devices. Below are the core relationships used by the converter.

  • Simple forward gamma (linear to encoded): E = L^(1/γ). L is linear light in 0–1, γ is display gamma, E is encoded output.
  • Simple inverse gamma (encoded to linear): L = E^γ. This recovers linear light from a power-law encoded signal.
  • sRGB forward (linear to encoded): if L ≤ 0.0031308 then E = 12.92 L; else E = 1.055 L^(1/2.4) − 0.055.
  • sRGB inverse (encoded to linear): if E ≤ 0.04045 then L = E / 12.92; else L = ((E + 0.055) / 1.055)^2.4.
  • Rec.709 OETF (camera/light to video): if L < 0.018 then E = 4.5 L; else E = 1.099 L^0.45 − 0.099.
  • BT.1886 EOTF (video to display light): L = [(V + Vo) / (1 + Vo)]^γ scaled to black and white, where Vo models display black.

The simple power-law is easy and often good enough for preview. sRGB and Rec.709 add piecewise segments to improve low-light behavior. BT.1886 models actual display black and yields better consistency in dim viewing. The converter implements these formulas and normalizes values to 0–1 unless you choose integer code values.

How to Use Gamma Correction (Step by Step)

Most workflows follow a predictable order. You identify the encoding, choose the right transform, and confirm value ranges. Then you convert and verify the result.

  • Determine if your data is linear light or gamma-encoded signal.
  • Select the matching curve: sRGB, Rec.709, BT.1886, or a custom exponent.
  • Normalize your data to 0–1 if it is stored as integers (for example 0–255).
  • Apply the forward transform for linear to encoded, or inverse for encoded to linear.
  • Clamp out-of-range values and round to the target bit depth.
  • Compare against a reference patch or known ramp to validate the output.

These steps protect midtones and prevent banding. They also help you avoid double-encoding, which makes images look too dark. Use your viewer’s histogram and notes to confirm clipping did not occur.

Inputs and Assumptions for Gamma Correction

Gamma correction relies on clear inputs and consistent assumptions. The converter asks for a few key items and uses defaults that match industry practices. You can override defaults through options as needed.

  • Encoding type: forward (linear to encoded) or inverse (encoded to linear).
  • Curve preset or custom gamma exponent (for example 2.2, 2.4, sRGB, Rec.709, BT.1886).
  • Input range and bit depth (0–1, 0–255, 10-bit, 12-bit).
  • Black offset or epsilon for BT.1886 or to avoid zero-power artifacts.
  • Rounding mode and clamping behavior for final output.
  • Per-channel or linked RGB processing, with optional handling for alpha.

Typical values lie within 0–1 after normalization. Values below 0 or above 1 can occur during computation and are either clamped or left as-is based on options. Near-zero inputs are sensitive to rounding and may need an epsilon. Negative inputs are invalid for power functions and will trigger a warning.

Using the Gamma Correction Converter: A Walkthrough

Here’s a concise overview before we dive into the key points:

  1. Choose the transform direction: linear to encoded or encoded to linear.
  2. Select a preset curve (sRGB, Rec.709, BT.1886) or enter a custom gamma exponent.
  3. Set input scaling (0–1 or integer code values) and the desired output bit depth.
  4. Open options to set clamp behavior, rounding mode, and any black offset.
  5. Enter your value or paste an RGB triplet; toggle per-channel processing if needed.
  6. Run the conversion and review the output with the tool’s notes and warnings.

These points provide quick orientation—use them alongside the full explanations in this page.

Real-World Examples

Compositing an sRGB image requires linear light. A mid-gray pixel with sRGB code 128 maps to E = 128/255 = 0.502. Using the sRGB inverse, L = ((0.502 + 0.055) / 1.055)^2.4 ≈ 0.216. In linear compositing, this value blends correctly with highlights and shadows. What this means: a pixel that looked “half gray” by code is closer to 21.6% in true light.

Grading for a dim surround with a gamma 2.4 display needs proper signal encoding. Suppose your scene-referred gray is L = 0.75. With a simple forward model, E = L^(1/2.4) ≈ 0.906, which becomes code ≈ 231 in 8-bit. This keeps mid-high tones bright without crushing shadows. What this means: a linear 75% light value encodes near 231 to reproduce the intended brightness on a 2.4 gamma display.

Assumptions, Caveats & Edge Cases

Gamma curves are models. They are not perfect descriptions of every display or camera. Different standards use different viewing assumptions, surrounds, and black levels. Keep these caveats in mind when interpreting results.

  • Double encoding darkens images; double decoding washes them out. Confirm direction.
  • sRGB and Rec.709 differ in their low-end segments; results are close but not identical.
  • BT.1886 needs a realistic black offset for accurate shadow rendering.
  • Compositing should be done in linear light, then re-encoded at the end.
  • Premultiplied alpha requires care; gamma-correct color but keep alpha linear.

Always test with gray ramps and color bars. Match your viewer to the same transfer function used in the conversion. If your display does tone mapping or dynamic contrast, disable it during evaluation. Misaligned assumptions about black, surround, or tone mapping can mask errors.

Units Reference

Gamma correction connects numerical signal codes to physical or relative light. Knowing units helps you interpret what a value means in your system. In many cases we use relative units to avoid tying results to a specific device.

Common quantities in gamma workflows
Quantity Unit or Symbol Notes
Linear luminance Relative (0–1) Proportional to light output; unitless when normalized.
Display luminance cd/m² Physical brightness; depends on display calibration and peak nits.
Encoded signal value 0–1 or 8/10/12-bit code Stored or transmitted code values before or after gamma.
Gamma exponent γ (unitless) Exponent in the power-law model; examples: 2.2, 2.4.
Luminous flux lm Occasionally used in photometry; not required for normalized work.
Optical power W Radiometric measure; useful for device characterization.

Use the table to map your scenario to the right measure. Most conversions in this tool operate on relative 0–1 values. Convert to physical units only when characterizing a display or matching absolute brightness.

Troubleshooting

If results look too dark or too bright, the most common cause is a direction mismatch. You may have applied a forward gamma when you needed an inverse, or selected the wrong preset. The second most common cause is range mismatch between 0–1 and 0–255.

  • Verify direction: linear to encoded or encoded to linear.
  • Check the preset: sRGB vs Rec.709 values differ near black.
  • Confirm input scaling and bit depth settings.
  • Disable display enhancements like dynamic contrast during checks.

If clipping occurs, enable clamping or adjust the black offset. If banding appears, use higher bit depth and dithering. Review the tool’s notes for warnings about negative inputs or NaN values.

FAQ about Gamma Correction Converter

What is gamma correction in simple terms?

Gamma correction applies an exponent so stored code values match how we see brightness. It ensures midtones look right on standard displays.

When should I use sRGB versus Rec.709?

sRGB is common for web and desktop graphics. Rec.709 is for HDTV production. They are similar, but differ in low-end behavior and viewing assumptions.

Why do my composited images look wrong without gamma correction?

Blending should occur in linear light. If you blend in gamma-encoded space, midtones and highlights combine incorrectly, producing halos and dull contrast.

What is the difference between gamma 2.2 and 2.4?

Gamma 2.2 is typical for bright surroundings. Gamma 2.4 is common in dim rooms and mastering suites. It gives deeper shadows and stronger midtone contrast.

Key Terms in Gamma Correction

Gamma

Gamma is the exponent in a power-law relationship between linear light and encoded signal. It shapes midtone contrast.

Linear Light

Linear light values are proportional to physical luminance. They are required for physically correct compositing and color math.

Encoded Signal

The encoded signal is the non-linear representation stored or transmitted. It saves bits where the eye is most sensitive.

OETF

Opto-Electronic Transfer Function maps scene light to a camera or encoding signal. Rec.709 provides a standard OETF.

EOTF

Electro-Optical Transfer Function maps signal to display light. BT.1886 defines the EOTF used for HDTV mastering.

sRGB

sRGB is a color space with a piecewise transfer curve approximating gamma 2.4. It is widely used for web and consumer images.

Bit Depth

Bit depth is the number of bits per channel used to store values. Higher bit depth reduces banding after gamma transforms.

Black Offset

Black offset models nonzero display black. It improves shadow accuracy by avoiding unrealistic pure-zero assumptions.

Sources & Further Reading

Here’s a concise overview before we dive into the key points:

These points provide quick orientation—use them alongside the full explanations in this page.

Leave a Comment