🖼️ HDR Tonemapping Operators

High Dynamic Range images need tonemapping to display on LDR screens. Compare Reinhard, Filmic ACES, Drago, and Durand operators. See gamma, exposure, and local contrast mapping.

Computational PhotographyInteractive
Use controls to compare operators · Split view shows before/after

How it Works

HDR tonemapping compresses a scene's wide luminance range into the narrow range a display can show. The simulator generates synthetic HDR radiance maps for four scene types, then applies the selected operator in real-time.

Each pixel has a linear HDR luminance value L. The operator maps L → L' in [0,1], which is then gamma-encoded for display. Exposure EV shifts the input by 2^EV before mapping.

Reinhard: L' = (L · key/Lavg) / (1 + L · key/Lavg) ACES Filmic: L' = (L(2.51L + 0.03)) / (L(2.43L + 0.59) + 0.14) Drago: L' = log(1 + b·L) / log(1 + b·Lmax) Display: out = clamp(L', 0, 1)^(1/gamma)

Frequently Asked Questions

What is HDR tonemapping?

HDR tonemapping converts a high dynamic range image (luminance ratios up to 100,000:1) into a low dynamic range image suitable for standard monitors (typically 100:1 contrast ratio), preserving perceptual detail across the entire range.

What is the Reinhard tonemapping operator?

The Reinhard operator maps luminance L to L/(1+L), a simple global operator that compresses highlights while preserving shadow detail. It is mathematically elegant but can produce slightly desaturated results in saturated scenes.

What makes ACES Filmic tonemapping special?

ACES (Academy Color Encoding System) Filmic uses an S-curve that mimics photographic film response. It clips bright highlights naturally and preserves color saturation better than simple Reinhard mapping, making it popular in game engines.

What is the Drago tonemapping operator?

The Drago operator uses logarithmic compression with an adaptive bias parameter. It is particularly effective for scenes with very high dynamic range and produces natural-looking results for outdoor photography.

How does gamma correction relate to tonemapping?

Gamma correction (typically gamma 2.2) converts linear light values to perceptually uniform display values. Tonemapping operators work in linear light space and gamma is applied as a final step before display.

What is exposure in tonemapping?

Exposure in tonemapping is a multiplier applied to the linear HDR image before the tone curve. Increasing exposure brightens the image overall, similar to extending shutter time in photography, expressed in EV (exposure value) stops.

What is local vs global tonemapping?

Global tonemapping applies the same curve to every pixel independently. Local tonemapping (like Durand) analyzes spatial neighborhoods to boost local contrast, revealing detail in both shadows and highlights simultaneously.

What is the Durand tonemapping operator?

The Durand bilateral tonemapping operator decomposes an image into a large-scale base layer and a detail layer using a bilateral filter. The base is compressed while the detail layer is preserved, enhancing local contrast.

Why do HDR images look flat on a standard monitor?

Standard monitors display about 8 bits per channel (256 levels), while HDR scenes may span 20+ stops of light. Without tonemapping, simply clamping values to 0-255 loses all highlight detail and appears washed out.

What is the key parameter in Reinhard tonemapping?

The key parameter (often called 'a', typically 0.18) controls the overall brightness target. Reinhard first maps the log-average luminance to this key value, then applies the L/(1+L) compression curve across the image.

About this simulation

This simulator generates a synthetic HDR radiance map — sunset sky, lit interior, forest canopy, or night city — with luminance values spanning several orders of magnitude, then applies Reinhard, ACES Filmic, Drago, or a linear pass-through in real time so you can see exactly how each operator compresses that range onto an 8-bit display. Toggle Split View to see the raw clamped image side by side with the tonemapped result.

🔬 What it shows

A procedurally generated HDR scene rendered through your chosen tonemapping curve, with live statistics on min/max luminance, log-average luminance, and dynamic range so you can see exactly how extreme the input actually is.

🎮 How to use

Pick an Operator (Reinhard, ACES Filmic, Drago Log, Durand Local, or Linear), adjust Exposure EV and Gamma, tune the Reinhard Key parameter, and switch Scene type between sunset, interior, forest, and city. Press ⧉ Split View to compare before/after.

💡 Did you know?

Selecting Linear (no map) on the sunset scene reveals why tonemapping exists at all: with luminance values in the sun disc reaching roughly 1000x the sky's, simply clamping to [0,1] blows every bright pixel to solid white and crushes shadow detail to black.

Frequently asked questions

Why does the sunset scene need a stronger operator than the forest scene?

buildHDR() gives the sunset's sun disc a luminance spike up to roughly 1000 (via Math.exp(-dist²·80)·1000) against a sky around 8, a dynamic range far wider than the forest canopy's softer highlights — the Statistics panel's Dynamic range readout will show this directly when you switch Scene type.

Why does raising Exposure EV brighten the whole image before the tonemap curve runs?

EV shifts the linear HDR luminance by a factor of 2^EV before any operator is applied, exactly mimicking a camera's exposure control — this means increasing EV can push previously mid-range pixels into the operator's highlight-compression region, changing which details get preserved.

What does the Reinhard Key slider actually control?

Key sets the target middle-grey brightness that the log-average scene luminance gets mapped to before the L/(1+L) compression curve runs — raising Key makes the whole rendered image appear brighter overall, independent of the curve's highlight-rolloff shape.

Why does ACES Filmic keep colors looking punchier than Reinhard on the same scene?

The ACES formula L(2.51L+0.03)/(L(2.43L+0.59)+0.14) is an S-shaped curve that compresses highlights more gently near the toe and shoulder than Reinhard's L/(1+L), which is why film-style operators preserve more perceived saturation in bright areas.

Why does switching to Drago change the shadows differently than the highlights?

Drago's log(1+bL)/log(1+bLmax) formula compresses using a logarithm anchored to the scene's actual maximum luminance Lmax, so scenes with a very bright outlier (like the sunset's sun disc) get their overall highlight range squeezed harder while midtones and shadows are relatively less affected.