PIXELBANKv9.1.0
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:

For L = 1.0 and L_white = 2.0:

  1. Compute L/L_whiteΒ²: 1.0 / (2.0)Β² = 1.0 / 4.0 = 0.25
  2. Compute numerator: 1.0 Γ— (1 + 0.25) = 1.0 Γ— 1.25 = 1.25
  3. Compute denominator: 1 + 1.0 = 2.0
  4. Final result: 1.25 / 2.0 = 0.625

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
πŸ”’

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

0/0
Run code to see test results.
Extended Reinhard with White Point - Medium | PixelBank