HDR Tone Mapping and Shadow Contrast in 8-Bit JPEG
Tone mapping a high-dynamic-range (HDR) scene into a standard 8-bit JPEG fundamentally alters shadow contrast by compressing a vast luminance range into just 256 discrete tonal steps per channel. While this process prevents shadows from clipping into pure black, it routinely degrades micro-contrast, introduces quantization artifacts, and can cause shadows to appear either unnaturally flat or excessively noisy depending on whether global or local tone-mapping operators are applied.
Dynamic Range Compression and Quantization
An HDR scene often spans a dynamic range of 14 stops or more, whereas a standard 8-bit JPEG is constrained to a dynamic range of roughly 8 to 9 stops. When mapping high-bit-depth data (typically 10-bit to 32-bit floating point) to 8-bit integer values (0–255), the available tonal values must be redistributed.
Because the human visual system perceives brightness logarithmically, linear raw shadow data contains the fewest discrete code values. Lifting these low values into visible 8-bit tonal zones stretches a small amount of original data over a wider digital range. This stretching causes posterization, commonly known as banding, which degrades the subtle tonal gradients that define natural shadow contrast.
Global vs. Local Tone Mapping Effects
The method chosen to compress dynamic range dictates how shadow contrast is perceived:
- Global Tone Mapping: Global operators apply a uniform transfer function (such as a logarithmic, Reinhard, or sigmoidal curve) across the entire image. To preserve highlight detail without clipping, global curves compress the tonal range uniformly. This typically flattens shadow contrast, rendering deep darks as a washed-out, muddy gray with very little distinction between adjacent dark tones.
- Local Tone Mapping: Local operators adjust pixel values based on surrounding spatial information (often using edge-preserving algorithms like bilateral filters). While this preserves or even enhances edge contrast (micro-contrast) within dark regions, it often compresses low-frequency contrast. The result is shadows that reveal high-frequency texture but lack overall depth, sometimes introducing visible halo artifacts where bright areas meet dark borders.
Noise Floor Amplification
In high-dynamic-range captures, the lowest luminance values are closest to the camera sensor's read noise floor. When tone mapping aggressively brightens deep shadows to fit the 8-bit container's midtone range, it amplifies this random sensor noise. High luminance and chrominance noise in dark regions destroys fine detail and masks subtle edges, significantly lowering the effective, perceived contrast within the shadows.
Gamma Encoding and Bit Distribution
Standard 8-bit JPEGs utilize the sRGB or Rec. 709 gamma curve, which allocates more bits to darker values to match human perception. However, because tone mapping has already non-linearly compressed the scene prior to standard gamma encoding, the interaction between tone-mapping curves and sRGB transfer functions can lead to non-linear contrast loss. Mid-tones often expand at the direct expense of shadow slope steepness, leaving dark areas with a reduced gradient slope and lower punch.