Shadows / highlights tool


Hi folks, I’m really impressed with how HDR tone mapping works and cope with highlights and shadows. No visible halos, artifacts, pretty optimized and fast. Nicely done! It has made the old module 'shadows / highlights obsolete for me. But I was just thinking… is it possible to somehow use this algorithm in order to use is exclusively on shadows or highlights?

(Alberto) #2

Hi @kazah7,
although not based on tone-mapping, perhaps you might be interested in this:

If you feel like giving it a try, I’d appreciate the feedback (negative as well, of course).


Thanks, I will try it and let you know : )


Don’t realy have much time but the results you in the first video are great.

(Sebastien Guyader) #5

@agriggio Alberto, I like your new implementation of the shadows/highlights tool. I my test cases, it was mostly the shadow-lifting side of the tool that I tested, which is more natural that the earlier implementation. Colors in the shadows lifted with this tool are somehow less saturated that what the HDR Tone mapping does, but one can compensate for it by using the Lab* chromaticity slider for example.
Great job again!

Edit: I just reverted to the old version, opened the same image with the pp3 from the image edited with the new tool, and… yuck… terrible result with the old tool! IMO you can push the commits!

(Alberto) #6

Hi all, thanks for the feedback! I also like the new one better than the old :slight_smile:
The concerns are currently:

  • the new tool is incompatible with the old one. Pictures that looked good with the old implementation might look quite bad with the new one, as there is no attempt at preserving the meaning of the parameters

  • is the current version better enough (assuming it’s better at all, of course…) to break backwards compatibility?

  • are there drawbacks/regressions?

Personally, I never managed to find a good use of the old shadows/highlights tool, but it’s very possible that I just never learnt how to use it properly.

(Sebastien Guyader) #7

I almost never used the old old one because it wasn’t working well for me 99% of the time (it produced halos, and shadows looked quite washed out to me). Lately, I used HDR tone mapping as a sort of Shadows/Highlights tool.
But the new S/H tool is definitely working, and much much better.
I guess the old tool was not used very often, so breaking backwards compatibility is probably not a huge problem. Besides, if one opens an image which used the old tool, it won’t look horrible, and getting a better look will be easy. Just my 2 cts.


Hello, after few tries I must say that I like it much more then the previous one. Sometimes it gave me a satisfactory result, in the other cases - almost fine ;). My two cents:

  • in situations with crazy high dynamic range, shadows were raised but the new algorithm made them washed out, with no contrast. Of course, I was able to introduce some punch using another set of curves, but it was an extra step (which is also fine!)… However, the old method, with its drawbacks and halos, gave us also some contrast.
  • comparing to Lightroom (I know…!) highlights sometimes were not rescued. Look at the movie attached. It’s not like there is no information in the picture. It is there, but the effect is too weak?..

btw. what are you guys using to record screen?

DSC06368.ARW (18.0 MB)

(Alberto) #9

Hi @kazah7, thanks for the feedback!
To answer your questions (and also @sguyader in part) :

Well it’s also a matter of finding the “sweet spot”. If you are talking about the desturation in the shadows, the tool tries to raise the chromaticity when pushing shadows, but currently it’s a bit conservative. I can try making it a bit more aggressive. If you are lacking local contrast, well there’s another tool for that :slight_smile: (if instead I just didn’t get your point, please clarify, thanks!)

better now? (I have no idea how the lightroom slider works, but I suspect there’s a lot going on behind that simple slider…)

(Morgan Hardwood) #10

@agriggio that’s amazing!


Gosh! Of course. No further questions when it comes to highlights :slight_smile: About that sweet contrast spot - you got my point, if you make it a bit more aggressive, it will be perfect. Thanks for awesome work!!

(Alberto) #12

Hi @kazah7 and @sguyader,
do you have examples showing the “washed out” effect when lifting shadows (ideally also with a rendering of what you consider acceptable)? Seeing a couple of samples would be quite helpful in tuning the tool…


(Sebastien Guyader) #13

@agriggio I was just seeing more subdued colors when to compared to the HDR Tone mapping tool. I didn’t want to say it is a problem, and colors can easily be boosted if needed with saturation or chromaticity sliders for example.
I just tried quickly comparing both tools, if I lift shadows in both to raise L* to about 14, a* and b* values measure around 5-6 with S/H tool, and 10-11 with HDR TM. Or in HSV, when V is around 18% for both, S measures around 35% with S/H tool and 65% with HTR TM.
But… the look is more natural to me with the S/H tool. It’s a matter of taste I think.


So, as @sguyader said it’s a matter of taste. In my opinion, there are some situations in which this additional punch would be needed. Check out this photo. I managed to add more contrast, and only to the shadows area, using wavelets. DSC02244.ARW (41.1 MB)
shadows.pp3 (11.3 KB)

Maybe it is too much, but you should get my point. Another thing is somehow connected to @sguyader’s question. How would you give more saturation only to the sky from my previous photo? CL curve form LAB does not do the job. Darktable has additional two sliders to deal with it - “highlights&shadows colour adjustment”.


Another challenging photo, and similar story with contrast.But as I said, it can all be done using different set of tools.It is simply a matter of time.DSC02255.ARW (41.0 MB)

(Alberto) #16

Hi all,
thanks for the feedback (and the test images), very helpful!
I’ve just pushed a small tweak that tries to add a bit more contrast to the shadows. It’s subtle, don’t expect big changes, but in my (so far limited) tests it seems helpful.
A couple more comments:

But… the look is more natural to me with the S/H tool. It’s a matter of taste I think.

I agree it’s a matter of taste. But don’t be afraid to use both tools together! FWIW, this is what I do in challenging situations – see below. Incidentally, I wouldn’t be surprised if Lightroom was applying some tone mapping under the hood (though of course I’m not sure).

Check out this photo
Another challenging photo, and similar story with contrast

Thanks for sharing, these are challenging indeed! My approach was to use both HDR tone mapping (for an initial compression of the dynamic range) and the shadows/highlights tool (for further tweaks). Here are my results, just in case. I’m reasonably happy with the first one, not so much with the second… surely we won’t run out of things to do :slight_smile:

DSC02244.ARW.pp3 (10.5 KB)

DSC02255.ARW.pp3 (10.6 KB)

(Sebastien Guyader) #17

@agriggio Just a suggestion, don’t know if it’s possible to do. In general, shadows have a cooler color temperature than sunlit parts. As a consequence, when we lift the shadows, the difference in color temperature is more obvious. It’s particularly visible in the two images above: warm sunlit background, cool/blueish shadows.
Would it be possible to add a slider allowing to warm up the lifted shadows in such situations?

(Morgan Hardwood) #18

@sguyader as a workaround, I use color toning for that.

(Alberto) #19

I agree with @Morgan_Hardwood

(Sebastien Guyader) #20

@Morgan_Hardwood Interesting, I actually never used color toning besides experimenting, I’ll give it a try.

Edit: I discovered the “L*a*b* Color correction grid” tool in Color toning, I like it a lot!