AI Glossary / Computer vision and multimodal AI / Intermediate

Linear light

Definition

Linear light describes an image representation in which numerical values are proportional to the represented light quantity within a defined color and reference system. Doubling a value therefore corresponds to doubling that represented quantity before clipping or other nonlinear processing. Linear-light values are useful for operations such as physically meaningful averaging, compositing, and lighting calculations.

What it means

Many images are stored using a nonlinear transfer function, such as the encoding associated with sRGB. Those stored numbers allocate code values in a useful way for display and storage, but ordinary arithmetic on them does not generally correspond to arithmetic on light.

Linear light is not a complete color-space specification. The primaries, white point, reference scale, and whether values are scene-referred or display-referred still matter. Two linear RGB systems can represent different colors with the same three numbers.

Likewise, using floating-point storage does not automatically make an image linear. Floating-point values can hold nonlinear encodings too. The meaning of the data comes from the representation and processing history, not simply the file extension or numerical type.

How it works

Identify the input's transfer function and color space. Decode nonlinear color values into a suitable linear representation before operations that are intended to combine light contributions.

Perform the calculation in adequate precision and range. For example, average linear samples when approximating the mean light from a region, or combine compatible linear contributions during rendering.

Apply the required output transform and encoding when preparing the result for its display or storage format. Scene values may also need exposure adjustment, tone mapping, or color-space conversion; encoding alone does not solve every display problem.

Avoid decoding twice or treating already linear data as encoded. Also distinguish color channels from noncolor data. A texture storing roughness, masks, or geometry does not necessarily need the same transfer-function processing as a photograph.

Three practical examples

1. Image resizing: An imaging pipeline averages suitable linear-light samples so a mixture of bright and dark pixels reflects the intended light average.

2. Visual effects: A compositor combines rendered elements and footage in a documented working representation, reducing unintended dark or bright transition artifacts caused by inconsistent encodings.

3. Rendering: A graphics system adds direct and indirect illumination contributions in linear quantities before applying a viewing transform for the final image.

Think of it this way

Think of adding distances after converting all measurements to meters, instead of averaging arbitrary codes that represent distance nonlinearly. The conversion makes the arithmetic correspond to the quantity of interest. The analogy is limited because linear-light workflows also require compatible color definitions and may involve scene-to-display transformations beyond a simple unit conversion.

Worked example

Consider two grayscale samples representing black and reference white, with linear values 0 and 1. Their equal light average is (0 + 1)/2 = 0.5.

Using the standard sRGB encoding, a linear value of 0.5 is encoded at approximately 0.735, or about 188 on an eight-bit scale. By contrast, directly averaging the encoded endpoint values 0 and 1 gives 0.5 in encoded space.

Decoding that encoded value of 0.5 yields only about 0.214 in linear light. Thus the direct encoded-space average represents much less than half the reference-white light level. This difference explains why some blending and resizing operations can look unexpectedly dark when performed in the wrong representation.

The example assumes neutral values, the standard sRGB transfer function, and an equal-weight average. It does not establish that every artistic blend must use the same method. It shows that encoded-value arithmetic and linear-light arithmetic answer different numerical questions. The intended operation should determine which representation is appropriate.

Illustrative case study

Fictional case study: A web-imaging team notices dark seams where a bright graphic is smoothly blended into a dark background. Its pipeline has mixed an encoded image with a rendered element without consistently interpreting their values.

The engineers document the working color space, decode the appropriate color inputs, and perform a controlled blending comparison. They also discover that a mask was incorrectly processed as if it were an encoded photograph, changing the intended blend weights.

After separating color decoding from mask handling, the team reviews the result across representative graphics and export formats. The scenario illustrates data interpretation and pipeline consistency rather than a claim that every visible seam has a transfer-function cause.

Common misconceptions and mistakes

Linear light does not mean visually uniform steps. Human brightness perception is not simply proportional to the numerical light values.

sRGB encoding is not exactly a single power of 2.2. Its defined transfer function includes a small linear segment and a nonlinear portion, so accurate conversions should use the specified function.

Dividing an eight-bit encoded value by 255 only normalizes its range. It does not undo the encoding.

Linear data can exceed 1 in some workflows, especially scene-referred representations. A value above 1 is not automatically invalid, although the intended reference and output handling must be clear.

Linearizing color values does not repair clipping, recover missing highlights, or ensure that the source image is physically calibrated.

Business use

A consistent linear-light workflow can improve predictability in rendering, compositing, and image resampling. It helps teams distinguish physical light arithmetic from display-oriented edits and prevents subtle mismatches between software components.

Record input encodings, working color spaces, and output transforms. Test simple black-and-white mixtures, gradients, and known color samples as well as realistic images. Evaluate the complete pipeline because correct intermediate arithmetic can still be displayed incorrectly if the final encoding or color interpretation is wrong. For creative operations, document intentional departures from physically motivated blending rather than relying on accidental defaults.

People also ask

Is a normalized value between zero and one necessarily linear?

No. Nonlinear encoded values are often normalized to that same range.

Does linear RGB identify one unique color space?

No. Different primaries, white points, and reference conventions can define different linear RGB systems.

Should every image channel be sRGB-decoded?

No. Noncolor channels such as masks or roughness maps need interpretation according to what they store.

Check your understanding

Does dividing an sRGB code value of 128 by 255 convert it to linear light?

Answer: No. It produces a normalized encoded value of about 0.502. The sRGB decoding function is still needed to obtain its corresponding linear value.

Related terms

  • Transfer function
  • Gamma encoding
  • Tone mapping
  • sRGB
  • scene-referred color
  • alpha compositing
  • color management

Learn next

Compare averaging in encoded and linear representations using a black-and-white test pattern. Then trace a complete color pipeline, identifying where decoding, color conversion, tone mapping, and final encoding occur.

  • White test
  • Tone mapping

More in Computer vision and multimodal AI

  • Linear filter - A linear filter transforms a signal or image while preserving superposition: filtering a weighted sum of inputs gives the same result as taking the...
  • Linear interpolation - Linear interpolation estimates a value between two known samples by following the straight line that connects them.
  • Linear inverse problem - A linear inverse problem estimates an unknown quantity from measurements related to it by a linear forward model.
  • Linear shift-invariant (LSI) filter - A linear shift-invariant filter, or LSI filter, preserves superposition and responds the same way when an input pattern is shifted in space.
  • Local Laplacian filters - Local Laplacian filters are edge-aware image-processing methods that construct an output Laplacian pyramid using locally centered nonlinear intensity...
  • Local tone mapping - Local tone mapping adjusts an image's tonal values using information about each location's surroundings.

Sources

Physically Based Rendering, fourth edition, Images, Color Encodings: https://www.pbr-book.org/4ed/Utilities/Images

The primary technical text was opened and its linear and sRGB encoding discussion checked. Numerical averages and the web-imaging scenario are original teaching examples.

Previous: Linear least squares Next: Linear map

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer