Skip to content

HDR merging and tone mapping

Algorithm atlasPhotography

Combine exposure information or fuse well-exposed regions, then map the result into a displayable range.

Try it on your image ↓

VISUAL WALKTHROUGHPhotography
REFERENCE INPUTBracketed exposures

Different exposures preserve useful information in different intensity ranges.

RESULTMap the merged result for display

The drawing illustrates combined visibility. Radiance estimation and exposure fusion have different outputs; tone mapping applies to a radiance result.

STEP 03 / 03

Tone-map a radiance result for the target display.

Illustrative example. The stages explain the method; they are not a live OpenCV execution.

Try it on an image

YOUR IMAGE · REAL OPENCV

Experiment at pixel level

Open full lab ↗

Fuse two exposure images with Mertens exposure fusion. Without an upload, the second image is a darker exposure of the input. This experiment produces an LDR fusion, not calibrated HDR radiance.

The engine loads on your first run. Your images stay in this browser.

Input448 × 320
OutputWaiting for a result

Scroll over either image to zoom at the pointer. Use the scrollbars to pan both views over the same relative area. Zoom is relative to the input; pixel coordinates belong to each image. Warps can change scene correspondence.

Pixel inspector RGBA · native values · matched scale · 9 × 9 output pixels
Hover to inspect. Click to pin a pixel.
Input
Select a pixel

Output
Select a pixel

Sample models and licenses

When to use it

Recover a wider scene brightness range from an exposure bracket or create an exposure-fused image.

How it works

  1. 01Align the bracketed images and account for exposure when required.
  2. 02Merge radiance estimates or fuse contrast, saturation and exposure quality.
  3. 03Tone-map a radiance result for the target display.

exposures → radiance or fusion → display mapping

What to tune

Debevec/Robertson use exposure information; Mertens performs exposure fusion. Tone-mapper parameters change appearance, not captured evidence.

Where it breaks down

Moving subjects cause ghosts. Exposure fusion is not the same as calibrated HDR radiance reconstruction.

TypeScript API

Open an entry for its exact overloads, parameter descriptions, result ownership and pinned upstream source.

All of these calls execute on the CPU. Native objects need explicit disposal. See matrices and ownership and build compatibility.