Learn / Tone Mapping

What is tone mapping?

The math that decides how a scene's real brightness gets squeezed — or stretched — onto whatever screen is actually showing it.

A camera sensor, or a real scene in front of you, can span a brightness range no consumer display can fully reproduce. Something has to give — either detail gets thrown away, or the whole range gets squeezed to fit. Tone mapping is the general name for that squeeze: a function that takes an input brightness value and remaps it to an output value that fits the target range, ideally without destroying what made the highlights and shadows look different from each other in the first place.

The simplest version: a straight line

The crudest possible tone mapping is linear scaling — multiply every pixel by the same factor. That works fine for the shadows and midtones, but it does nothing to solve the actual problem: if your brightest pixel is already at the display's ceiling, scaling everything down just makes the whole image dimmer without buying you any extra headroom for highlights specifically. Real tone-mapping curves are non-linear for exactly this reason — they leave the parts of the range that already fit alone, and only compress the parts that don't.

The knee: where compression actually starts

Most practical tone-mapping curves are identity below a threshold (a pixel that's already comfortably within range passes through completely unchanged) and compressed above it. That threshold is usually called the knee. Where you put the knee, and how sharply the curve bends there, changes the whole character of the result:

  • Hard knee — identity, then an abrupt cap. Simple, but it can create a visible band where detail suddenly stops.
  • Soft knee — identity, then a gradual curve (often built from a tanh or similar function) that asymptotically approaches the ceiling instead of hitting it. Highlights near the knee stay separated from each other instead of getting flattened together.
Headroom's Preview tool renders its "Simulated HDR preview" using exactly this shape: pixels are left byte-for-byte identical below a fixed knee, and a tanh-based soft-clip compresses everything above it toward white — the same idea real HDR-grading tools use to preview an HDR grade on an SDR monitor.

Two directions, same math

Tone mapping almost always comes up in the "down" direction — HDR or scene-referred brightness compressed down to fit an SDR display. But the same underlying idea runs in reverse too: taking an SDR image and deliberately stretching its highlights back out toward HDR headroom. That's what Encode's Highlight HDR and Full HDR modes actually do — they're inverse tone-mapping curves, remapping a limited input range up toward a target peak brightness instead of down. Superwhite mode is a more conservative version of the same idea, restricted to a fixed, very high threshold so it only touches pixels that were already close to blown out.

Inverse tone mapping can't invent detail that was never captured. If a sky was already fully clipped to flat white in the original SDR file, no curve can recover the gradation that would have been there in a genuinely HDR-captured version — it can only make that flat white area brighter, not more detailed.

Why this matters beyond one slider

Every HDR mode described on this site — Superwhite, Highlight HDR, Full HDR, and the gain map that ships in an exported file — is a tone-mapping curve under the hood, parameterized by a threshold, an intensity, and a target peak brightness. Understanding the curve shape is what makes the difference between "why doesn't this control do anything" and "this control only affects pixels above the knee" concrete instead of mysterious.

Questions people actually ask

Is tone mapping the same thing as clipping?
No — clipping just throws away anything past a limit, flattening every over-bright pixel to the same maximum value. Tone mapping compresses the range instead, so pixels that were brighter than each other before the transform are usually still brighter than each other after it, just closer together. That preserves separation between highlights instead of crushing them into a single flat white.
Does every HDR tool use the same tone-mapping curve?
No, and that's a real source of variation between tools. A hard-knee curve (identity, then a sudden cap) looks different from a soft-knee curve (identity, then a gradual compression) even at the same peak brightness target. Headroom's live preview specifically uses a soft-knee tanh compression above a fixed point, not a hard clip — the reasoning is in the FAQ on the Encode page.
Is inverse tone mapping a real thing, or did you make that term up?
It's real, if less commonly discussed than the forward direction. Standard tone mapping goes from a wider range down to a narrower one (HDR to SDR, or scene brightness to a printable range). Inverse tone mapping goes the other way — stretching an SDR image's highlights back out toward HDR, which is exactly what Encode's Highlight HDR and Full HDR modes do.