Tonemap: Local Tone Mapping on GPU for Single-Shot HDR
Updated:
Tonemap is the Fastvideo adaptive local tone mapping module for GPU pipelines. It compresses the dynamic range of an image so that scenes with both deep shadows and bright highlights render on a conventional display without losing detail at either end. It runs entirely on the NVIDIA GPU and processes every frame in a single shot — fast enough for real-time video, with no exposure bracketing — and works equally well on high bit-depth HDR sources and on ordinary 8-bit JPEG images that simply need shadow recovery and stronger local contrast.
Detailed benchmark data. Measured results are published on our benchmark pages: Tone-mapping benchmarks, all benchmarks.
How the Algorithm Works
The engine divides each frame into a grid of rectangular tiles and computes a compact set of local parameters per tile; keeping this set minimal is what makes the processing fast. Local and global statistics are then combined into a family of local tone curves, and the final transform is evaluated per pixel. Because the transform adapts to the content of each region rather than applying one global curve, the algorithm preserves image detail and local contrast where a global operator would flatten them.
A typical scenario: the camera's auto exposure protects highlights from clipping, which leaves the shadows underexposed. Local tone mapping lifts those shadows and restores local contrast without touching the correctly exposed regions.
The source 16-bit TIFF on the left is hard to visualize correctly on an 8-bit display; on the right is the tone-mapped result.
Not AHE, Not CLAHE
Our engine should not be confused with adaptive histogram equalization (AHE) or its contrast-limited variant (CLAHE). Beyond adaptive local contrast, it performs shadow recovery and local gain control, which is what makes the rendering pleasing rather than merely "equalized" — without the halos, amplified noise, and darkened skies that histogram-based methods are known for. The effect cannot be reproduced with global curves: the per-pixel transform is built from both global and local image features. The transform is fully deterministic and AI-free — the same input always yields the same output; see Deterministic ISP. And it applies to any source with enough information, from 16-bit HDR sensor data to plain JPEG, TIFF, BMP, PNG, or PPM/PGM files.
Performance
Tonemap processes a 65 MPix 16-bit RGB frame in 6.3 ms on the NVIDIA GeForce RTX 4090 (10 GPix/s). The figure is measured inside a GPU pipeline, with the source and processed data held in video memory and timing covering GPU computation only — that is the condition under which it holds. The same module runs on NVIDIA Jetson for embedded applications. Detailed benchmarks for desktop GPU and Jetson are on the tone-mapping benchmark page.
The ALTMapper application works with files on disk and is not the way to measure this: there most of the time goes to disk reads, JPEG decoding and re-encoding. Use it to judge image quality, and Tonemap or FastVCR to measure speed.
Video Mode: Temporally Stable Tone Mapping
The same engine runs on video. Local tone mapping computes its parameters from every region of every frame, and a naive per-frame implementation lets those parameters drift between frames — which shows up as brightness pulsing, “crawling” shadows and flicker, and also wastes bitrate because the codec spends bits on the flicker instead of on real detail. Tonemap keeps the local parameters temporally stable, so graded footage stays smooth frame to frame while it still lifts the shadows and holds the highlights. Because it processes each frame in a single shot on the GPU, it fits inside a live cinema or camera pipeline rather than an offline render queue.
See it on real footage: ARRI Alexa LogC cinema footage and a XIMEA 8.9 MPix industrial camera.
Applications
- Machine vision and industrial imaging
- Street view, mobile mapping, and aerial imaging
- Digital photography and digital cinema
- Medical imaging
- Broadcast and streaming
- Display devices and computer vision
Availability and licensing
Tonemap is licensed as a module of the Fastvideo SDK for integration into your own GPU pipeline, including camera applications built on FastVCR. Windows, Linux and NVIDIA Jetson are separate platforms and are licensed separately; deployment and support are quoted with the license.
The same algorithm as a ready-to-use application for files on disk is ALTMapper, with GUI, CLI and a downloadable demo.
Related: the same algorithm as ready-to-use software for files on disk — ALTMapper (GUI, CLI, demo). It also runs in a temporally-stable video mode (see above), with real-camera demos on ARRI Alexa LogC cinema footage and a XIMEA 8.9 MPix camera.