v9.1.1
Menu

Extended Reinhard with White Point

Apply extended Reinhard tone mapping with white point control.

The basic Reinhard operator never reaches pure white (1.0) because it asymptotically approaches 1. The extended version allows control over which luminance value maps to white:

Ld=L⋅(1+LLwhite2)1+LL_d = \frac{L \cdot \left(1 + \frac{L}{L_{white}^2}\right)}{1 + L}

where LwhiteL_{white} is the luminance value that should map to pure white (1.0).

Properties:

  • When L=LwhiteL = L_{white}: Ld=1.0L_d = 1.0 (reaches pure white)
  • When L≪LwhiteL \ll L_{white}: behaves like basic Reinhard
  • Allows intentional "burning out" of very bright highlights

This gives photographers control similar to choosing paper white in traditional printing.

Example

Input
reinhard_extended(1.0, 2.0)
Output
0.625
Reasoning
  • Inputs: L=1.0L = 1.0 is the scene luminance of one HDR pixel, and Lwhite=2.0L_{white} = 2.0 is the luminance you want to land exactly on pure white.
  • White-point term: the extra factor in the numerator is 1+LLwhite2=1+1.04.0=1.251 + \frac{L}{L_{white}^2} = 1 + \frac{1.0}{4.0} = 1.25. It grows with LL, which is what lets the curve climb all the way to 1.
  • Plugging in: Ld=1.0×1.251+1.0=1.252.0=0.625L_d = \frac{1.0 \times 1.25}{1 + 1.0} = \frac{1.25}{2.0} = 0.625, rounded to 4 decimal places gives 0.625.
  • Compare with basic Reinhard: without the white-point term you would get 1.02.0=0.5\frac{1.0}{2.0} = 0.5, so the extended curve brightens this midtone a little.
  • Notice that setting L=Lwhite=2.0L = L_{white} = 2.0 gives 2.0×1.53.0=1.0\frac{2.0 \times 1.5}{3.0} = 1.0 exactly, and inputs brighter than LwhiteL_{white} go above 1 (for example L=3.0L = 3.0 gives 1.31251.3125). That is the intentional burn-out of highlights the description mentions.

Constraints

  • L is HDR luminance value (non-negative)
  • L_white is the white point luminance (positive)
  • Return tone-mapped value rounded to 4 decimal places
  • When L = L_white, output should be 1.0

Learn this in

More from CV: Computational Photography

PRO

Editor locked

The code editor is locked for Pro problems. It is only available for free problems. Please upgrade to gain access to the code editor for all problems.

solution.py

Test results

Sign in to run your code against the test cases.