Expand description
Tone mapping and sRGB encoding.
Implements a tone reproduction pipeline for RAW image export:
- Apply
BaselineExposureas a linear gain in scene-linear space. - Apply the Hable/Uncharted2 filmic tone curve, with its white point set to the post-gain maximum so that sensor white always maps to display white. For negative BaselineExposure (extra highlight headroom), values above the “intended white” get smooth shoulder rolloff instead of hard clipping.
- Encode to sRGB (IEC 61966-2-1) with the piecewise gamma transfer function.
Output is comparable to dcraw/libraw defaults and correctly handles both negative BaselineExposure (e.g. iPhone ProRAW at -0.83 EV) and positive values.
Functions§
- apply_
tone_ reproduction - Apply tone reproduction to an RGB image.
- apply_
tonemap - Apply the full tone reproduction pipeline to an RGB image.