Highlight reconstruction darktable vs. rawtherapee

Thanks for sharing this image. It is an interesting image to show some of the challenges that DT has to face. I decided to see what Lightroom would do with this image. I am not that impressed with the LR rendition. There is a real lack of color in the sky. I will share my DT edit in a separate post.

1 Like

This is my DT edit. I probably prefer the edits by kofa. However, I played with the white point setting for the first time ever because of kofa’s suggestion. I also switched highlight reconstruction method to reconstruct in LCh and lowered the threshold until most of the magenta problem disappeared. I used both tone equalizer and shadow and highlights to work the balance of the sky and foreground. What is probably unique about my approach is that I used the color zones module to desaturate any residual magenta in the clouds while lifting the saturation of the blue sky at the same time.

I feel more work could be done on my image and maybe using masks to separate the work on the foreground and the sky would be useful. But I found it an interesting exercise while drinking my morning coffee. I will have to reinstall Rawtherapee and test this image on RT. I have always liked Rawtherapee, but the superior masking options in DT won me over.


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

That is done
DT


ART identique à RT

For highlight reconstruction RT/ART seems like the Webb telescope :sweat_smile:

1 Like

Your version looks great. When i tried in Rawtherapee my result was underwhelming. Can you share how you achieved this.

It’s been like that for a looong time. I preferred the dt rendering but switched to RT 7 years ago or so because to many of my shots had slightly clipped clouds/sky and RT has improved since. For someone photographing places/spaces/architecture clipped sky is unavoidable so ease of fix is important. Often the underexposure will be to much even with recent sensors if you fully avoid clipping.

1 Like

Ok, the best I can achieve with darktable includes some cheating:


2014-05-30_19-47-01_02.cr2.xmp (17.6 KB)

ART with the balanced highlights reconstrucion method
2014-05-30_19-47-01.cr2.arp (12.0 KB)

@kofa nice found about the white levels. That explains weird behavior for this file.

Now, as a test. I opened it in a recent Rawtherapee. I started with ‘neutral’ and switched to RCD to sort of match Darktable. I made sure to have no recovery, and I set the exposure to -2ev to be able to view the sky in a ‘raw’ form.

I did the same in Darktable. I ended up with a white point of 13452, white balance set to ‘as shot’, demosaic + oritentation as default, exposure set to -2ev, nothing else besides input/output profile.

Rawtherapee:

Darktable:

This

  • a) shows that ‘magenta skies’ is not something Darktable specific, it’s in your data.
  • b) that they both have sort of the same starting point.

Rawtherapee does seem a bit darker / duller, but it’s all neutral, and not meant to be a like-for-like.

Now, I enable ‘color propagation’ for Rawtherapee, and enable ‘reconstruct color’ in Darktable.

RT:
image

Darktable:
image

Here:

  • a) I seem to get artifacts in Darktable. Maybe from my dev build / compile / OpenCL stuff, maybe because of the tweaked white level. I don’t know.
  • b) The amount that gets reconstructed doesn’t seem different. If you ignore the artifacts, it seems pretty like for like?

It’s a shame I get these artifacts, because that kinda stops me in my tracks. I can switch to ‘reconstruct LCH’ or ‘guided laplacians’, but then it wouldn’t be like for like anymore.

If I set it to LCH and ‘continue as normal’, even using filmic v6 maxrgb (the new defaults) and my local-contrast bilateral trick after it, I can easily get something like this:

LCH isn’t the best method to preserve the blue in the sky, that would’ve been ‘reconstuct color’ which is bugging out for me.

To be honest, if I start completely from scratch in Rawtherapee (I apply ‘neutral’ then apply ‘standard film curve - low iso’), I switch to ‘color propagation’ and then lower exposure so that the clipping indicator says nothing is clipping (around -1.3ev to -1.4ev)… then apply the new ‘log encoding’ local adjustment to the full image, (almost) full scope with some tweaks I can easily get this:


You see the ‘color propagation’ working correctly here, and keeping the sky almost blue under the clouds. But the clouds lack ‘punch’ to be honest, but this was just some easy dragging of sliders. And there are tons of options to process an image like this in RT.

So, if the ‘reconstruct color’ was behaving correctly in DT here, I think I would prefer DT’s way of doing things (at least with my habits).

Although, most of the time I’m cheating myself, since I use DxO Photolab as a preprocessor often. If I do that here (setting it blindly to it’s ‘highlight priority strong’ option to process this image like I would’ve done a large batch of images), I can open the output DNG in Darktable to do the color / toning and go to this with the same method I’ve shown before:

The detail in the sky is… quite different. There is more to see in what even is flat blue part in RT’s version, and the highest clipped part is here suddenly turned to blue again instead of white? No clue how that works… you might prefer the look or not.

(An image like this is the reason why I always keep my cameras around -1ev at least, and if I have the time to think about it, I would take multiple shots… but there are loads of reasons why this can’t always work out of course, I know that…).

1 Like

I get those too, with some images. I’m running DT4.0 on windows, no OpenCL. I haven’t pinned down when it does/doesn’t happen though, although it’s certainly not tied to fiddling with the white level cos I’ve never done that before.

It’s a shame about the artefacts in the reconstruct colour highlights in darktable as it often it gives pretty decent results but you never know when the strange patterns are going to appear…

You can get similar looking artifacts from RT if you push colour propagation to far.

I used ART and it is not quite the same as RT.

What I did in ART:

enable:

  • exposure/color propagation
  • log tone mapping (an equivalent to filmic)
  • local contrast (there is the same in RT but somewhere else
  • tone curve
  • tone equalizer to bring back the high luminance
1 Like

I’d like to see a demonstration of that with this image, if you have the time.

I get these artifacts as well on many pictures when using “reconstruct colour”. This is really a shame, because otherwise the module works quite well.
However, the colour propagation module of RT and ART isn’t perfect as well. Look at the unnatural darkened ridge. Even so I think this should be easier to correct.

https://docs.darktable.org/usermanual/development/en/module-reference/processing-modules/highlight-reconstruction/

== reconstruct color ==

Use an algorithm that transfers color information from unclipped surroundings into the clipped highlights. This method works very well on areas with homogeneous colors and is especially useful on skin tones with smoothly fading highlights. Please note that this method can produce maze-like artifacts on highlights behind high-contrast edges, for example well-exposed fine structures in front of an overexposed background.

It’s how the algorithm works and I think there’s an issue or a topic where the devs explain that it can’t be fixed without rewriting it.

Also RT reconstruct color works on the already demosaicized image while the DT highlights reconstruction module works on pre demosaic data. They’re quite different.

Wanted to share quick extra thing… if I lower the exposure slider in DxO Photolab some more (manually, from it’s default ‘preserve highlights’-detection point) and then export as a DNG with no further edits (I have to make sure to use the ‘write normal full dng’ option, not the ‘optical corrections only’ thing, that doesn’t apply DxO’s reconstruction to the DNG and prevents Darktable from applying theirs :frowning: ).

It renders the sky as this in Darktable:

Which makes more sense compared to the others :wink:.

As another dirty ‘maybe it works trick’, instead of messing with local contrast after filmic or other things, you can use the tone equalizer to lower bright parts. As a sort of simple ‘thing to try’, I apply the tone equalizer preset ‘compress shadows/highlights (eigf)’ in soft/medium/strong. But I do two things:

  1. Since I want to only affect the highlights, I reset the curve in the darker parts. I do this by simply double clicking the sliders in the ‘simple’ tab:
    image

  2. To prevent me from having to mess with the exposure compensation and other parameter in the tone equalizer, for simple things I often try placing it before the exposure module in the pipeline (ctrl-shift dragging in Windows):
    image

I’ll upload the DxO DNG output and my Darktable sidecar file for this.
Although it’s kinda besides the point for this topic, since I’m bypassing ‘dealing with magenta’ by having a DNG from commercial software with it already prefixed…

The same rights apply to this DNG as the original CR2 from the author.
If the file needs to be removed for some reason, drop me a DM or any mod is (of course) free to act on it.

2014-05-30_19-47-01_fix-1.dng (50.2 MB)
2014-05-30_19-47-01_fix-1.dng.xmp (15.7 KB)

Thanks for pointing it out to me !
But I am still thinking ‘reconstruct color’ ‘color propagation’ is the same algorithm. Is that correct?
Why does Darktable give artifacts but RT doesn’t in this case ?

I don’t know where you read that they are the same algorithm. They work on different data (demosaic vs raw) and looking at the code they don’t really look the same.

See the RT header:


////////////////////////////////////////////////////////////////
//
//      Highlight reconstruction
//
//      copyright (c) 2008-2011  Emil Martinec <ejmartin@uchicago.edu>
//      copyright (c) 2019 Ingo Weyrich <heckflosse67@gmx.de>
//
//
// code dated: June 16, 2011
// code dated: July 09, 2019, speedups by Ingo Weyrich <heckflosse67@gmx.de>
//

DT first reconstruct color commit:

Probably the DT color propagation module is more similar (but not equal). I tried to use it sometimes putting it before the exposure module but it doesn’t always work and only with some filmic norms like none.

RT color reconstruction gives quite always really good results and also works on Fuji X-trans CFA and linear DNGs. I just miss the ability to tune some knobs.

Also If both this and also DT highlights reconstruction module could have multiple instances and masks it’ll help users to apply different reconstruction logic to different image parts.

I’m fine with this and any other use.

I didn’t read it , I assumed. So my (to be honest, expected ) mistake . They seem similar in name and results everytime I tried them.
My linear DNGs don’t open well in RT so i don’t know if it even works there or not. In DT the behavior is also quite different with a linear DNG (of the entire highlight reconstruction module to be honest ) so things line up. Same kind of name , same results (in my testing ) , same limits…

… and i just assumed that if one had clearly better results, the algorithm would’ve been shared already.