I have started to work on a dynamic range compression tool that, in combination with the existing film-like tone mapping curves, seem to give a quite natural rendering of HDR images.
The idea is rather simple:
- compute the log-luminance of the image (linear RGB input data is required)
- apply a bilateral blur to the log-luminance, and extract the high-frequency component
- apply a linear contrast reduction to the blurred log-luminance
- add back the high-frequency details
- undo the log encoding
- blend the new luminance with the original image colors
For reference, here is the starting point:
The new code has been committed into the stable branch. That’s how the new tool looks like:
The output of the dynamic range compressor is still linear HDR RGB data, which can be further manipulated. For example, I find that applying a film-like tone mapping curve on top of the dynamic compression (like in this specific example) allows to nicely recover the global contrast that is lost in the compression.
Feedback is highly appreciated as usual. Also, if you have any HDR image you would like to share and use to test this tool, please go ahead and submit!