Highlight reconstruction darktable vs. rawtherapee

Here is the information about the highlight reconstruction algorithm that is in development for Darktable

If you are familiar with testing development builds, please give it a go.

2 Likes

I have to agree that I wanted to try masking and using multiple instances of highlight reconstruction. I presume there are logical reasons this is not an option.

Would there be value in offering two options for highlight reconstruction where one is before and the other after demosaicing? Could the code from RT be adapted to DT for this purpose?

I presume there’s no windows build yet? Maybe @priort’s next weekly(?) version will have it? Looking forward to trying it out :grin:

Ha you are fishing…maybe have a go at getting set up to do WIndows builds… not too hard …

Build it from here until it gets merged…

If I have some time tomorrow I will build and post a version

Hi Todd, yes I was hoping you might bite… :wink:
I should look into building! Not sure when I will though :thinking:
Don’t hurry to build a version on my account - but it would be great :face_with_peeking_eye:

2 Likes

Wow!!! that was quick :grinning: now I want to try it instead of doing the work I was going to do… decisions…

Thanks Todd!

1 Like

Quick attempt with new HLR mode…

Second one with a bit more color…

You will need a build with this mode to open this…
2014-05-30_19-47-01_01.cr2.xmp (10.9 KB)

2 Likes

That looks good… one of the best DT versions yet IMO. (viewed on my laptop again - which is calibrated but has only 68% sRGB…colors sometimes look a bit off)
Edit: I might actually say the best yet.
Edit no2: At this point I think it’s a toss up between this one and one of @kofa’s using laplacians HR

Obviously I can’t make my mind up :roll_eyes:

Mine are a bit crushed…I used the tone eq to raise the foreground so tweaking that would likely improve that and some masking to protect or enhance some aspects… also I just pushed around the sliders on the new mode I really have not control over it or idea what I am doing :slight_smile:

I didn’t try to do a “best edit” at all. A few comments though

  1. Unfortunately the “whitepoint” is not exposed in a proper exif tag in this image, instead canon chose to use a makernote tag dt does not use so far. You can read that for example like
[hanno@fedora recovery]$ exiftool 2014-05-30_19-47-01.CR2 | grep White
White Balance                   : Auto
White Balance Red               : 0
White Balance Blue              : 0
Normal White Level              : 11767
Specular White Level            : 12279

and you should set the white point before doing fancy stuff. This will aide any hl handling algorithm (and more btw).

  1. You can now check much better the blown out sections, either by the “raw overexposed” button or the button in highlights module beside clipping threshold.

  2. To check for effect of any hl algorithm or compare i would switch off modules like filmic, color balance rgb, and reduce exposure so everything if easy to be evaluated. Your image will loke like


    , the xmp is
    2014-05-30_19-47-01.CR2.xmp (6.1 KB)

  3. Now try hl recovery or other algos and see how the colour cast is handled or details from unblown channels are used to keep details.

You may of course do how you like but this would be the technical way and would be the basis on all following modules. Masking stuff or whatever method you choose would always like “best available” in the input stage. Plus: colours are “calculated” in the demosicer and all algos used in that module would like best input data too.

3 Likes

Thanx for all the input. Judging from the shown results, the new tool look very promising. Will have a look on my desktop how well it works the next days. Is there a snap version for unstable, or do I have to build it on my own? And special thanx are going to the dt developers, for making a brilliant piece of software better and better!

I merged the new highlight recovery mode into R-Darktable, and wanted to show what it did by setting white-level and just enabling it… @hannoschwalm beat me to it by showing his own work :wink: .

I get a bit of red ‘hints’ around the brightest clipped area on the right, but this might be fixed by twiddling with the sliders (which I didn’t). Filmic’s ‘maxrgb’ default mode will bring that color more to the foreground, so I choose ‘luminance Y’. A bit of extra local contrast to the bright sky (not the dark clouds), a bit of diffuse-dehazing on the mountain in the background, and other regular ‘fixers’… not saying you have to like the edit, but it shows what can be done right from Darktable after @hannoschwalm’s work is available.

2014-05-30_19-47-01_01.cr2.xmp (17.9 KB)

Another - time consuming :stuck_out_tongue: - trick, I tried using Rawtherapee as a preprocessor. Opened the file, cleared everything to ‘neutral’. Switched demosaicing to RCD to match Darktable’s defaults, enabled chromatic fix in demosaicing, switch color profile to Rec2020, and export to Rec2020 16bit tif. Enable color propagation, lower exposure so nothing is clipped (but touch nothing else).

Load this tif into Darktable, raise exposure where you want it (to expose the foreground properly), enable filmic and other tools as you wish, the highlights are now already recovered in Rawtherapee so DT doesn’t has to deal with them. Things like denoise-profiled and lens-corrections pick up the original metadata so that appears to be working. Only white-balance changes with ‘color calibration’ is a bit of a PITA, but there are other ways to correct white balance if you need.

2 Likes

I see you set WP value using normal…just curious what is specular threshold meant to be used for?? I also thought I saw a linear sensor threshold at 10000. I wonder if that is some of the OEM secret sauce if they apply some non-linear functions to the channels at high values to manage clipping?? Really I have no idea but I guess as you get further from 10000 then linear wb corrections might create overshoots in some channels?? I really have absolutely no idea just curious…

For your second approach your export might not have a linear gamma but you could make one in RT…I haven’t used it for a bit so it might have one by default now

I don’t know. It’s not documented. Canon will know for sure…

1 Like

12279-11767=512. Black point?

It’s not, it’s gamma-corrected Rec2020… but it’s neatly tagged so Darktable loads the file just fine and puts it in a linear rec2020 working space again.

Yes, this means effectively RT applies some sort of gamma curve and DT tries to undo it again, but I’m not that bothered by it. If there was a ‘Linear rec2020’ in the RT profile box, I would’ve picked it. But this is fine as an example (and more).

Maybe having worked with film negative scans, where each channel gets gamma-corrected and inverted and multiplied to hell and back to still get a nice looking image at the end… maybe because of the grain…, but I’m not bothered by ‘mathematical inaccuracy’ of doing ‘pow 0.55556’ and then a ‘pow 1.18’ again :). In 16bit precision, it’s close enough to not be noticed.