I have done some further work on the shadows/highlights tool, and committed an improved version. The changes are mostly in the way the blurred mask is generated, and in the tone mapping function that is applied to compress the dynamic range.
The edge-preserving blur is based on a “guided filter pyramid”, in which guided blurs are applied to log-encoded luminance values at increasing radius and decreasing threshold. The resulting mask can effectively blur the low-contrast textures and preserve sharp edges, much better than a single high-radius guided blur.
This is probably the most relevant change in this new tool, and has been the most difficult part to develop… my suggestion is to gradually lower the threshold from its default value, until residual halos almost disappear but textures still retain their contrast.
The tone-mapping is essentially based on a power function, with different exponents for the shadows and highlights portions. However, a simple power function usually has a too strong effect in the deep shadows. I have therefore introduced a third adjustment that straightens the curve toward zero, restoring some contrast in the deep shadows.
An anchor parameter defines the split point between shadows and highlights, and is set to 50% (mid-gray) by default.
Here is how the interface looks like:
The tool tends to reduce the overall image contrast, which can be re-introduced with a slight S-shaped curve, for example using the tone-mapping tool:
I am in the process of writing a detailed blog post on the subject, meanwhile you can already find some side-by-side before/after comparisons.
Any feedback is very much appreciated! In particular regarding the halos suppression…