I struggle with HDR colors in darktable (and HDRMerge)

Hello !

I tried some HDR shots recently and dropped them in HDRMerge, now I’m trying to edit the result in darktable. I’m not satisfied with the result because the colors are very different (see the yellowish grass below). I don’t understand how to match the colors of my normal shots in the HDR.

Did I missed something related to HDR colorspace of something? Or is it related compatibility of HDRMerge with X-Trans sensors ? (I noticed alignment artifacts caused by HDRMerge not aligning for X-Trans sensors).

Here is the HDR DNG file and xmp:

DSCF4066-4068.dng (49.2 MB)
DSCF4066-4068.dng.xmp (12.2 KB)

And the original files:

DSCF4066.RAF (24.5 MB)
DSCF4067.RAF (27.6 MB)
DSCF4068.RAF (29.5 MB)
DSCF4068.RAF.xmp (12.1 KB)

All files are licensed CC BY-SA

To my uneducated eye - it just looks like your HDR expands the chroma. Someone much more educated in colour may have an explanation.

There are a few tools you can use - I used “Color Zones” to bring the chroma & lightness down.

Here is a before and after applying the “Color Zones” correction.

DSCF4066-4068.dng.xmp (23.7 KB)

I recommend that you use the really great “Play Raw” forum here - as many people will be able to offer a hundred different ways to get what you wish.

1 Like

Good spot… I was just considering it and hadn’t noticed that. :sweat_smile:
I don’t think it’s purely that though…
This is the single shot on left, HDR on right, with chroma matched using color balance rgb as close I could. Notice the hue difference both on the sky and grass. It’s an awful lot closer though.

DSCF4066-4068.dng.xmp (9.2 KB)
DSCF4067.RAF.xmp (9.8 KB)

Edit: Ooo, look at this - after the chroma reduction on the HDR file, setting hue shift to -5 degrees gets the colours really close.

DSCF4066-4068.dng.xmp (9.7 KB)


I had never work out how or why I would want to use that slider, so I am impressed that you have demonstrated a good use for it.

1 Like

The main thing I’ve used it for (aside from the odd corrective thing - like this) is in combination with a parametric mask for hue, to shift a certain colour range. Kind of like in color zones but more control.
I’m no authority on it though… :grin:

This is what I use it for all the time. I’ve never used it globally, but with a mask of some sort, its awesome. I use it to push colors towards some sort of harmony.


Does HDRMerge do any color space manipulation??

I used colour picker with the marker in the middle of the grass clearing.

4068 (over)

4067 (middle)

4066 (under)

HDRmerge DNG

You can see the marker on the plot rotate a smidgen around an almost fixed radius for the source images. But the same spot has significantly moved for the HDRmerge DNG.

This was done while fighting insomnia at 2am - so any mistakes are mine… (if someone would like to repeat). It would appear to show that HDRmerge DNG does rotate & shrink the Orange-Yellow channel significantly more than the Blue channel.


I think that is a fair representation on what you see. I tried to look at the exif data. I am not much of an expert but the dng seems only to have one d65 matrix… I may have to go back and look. Std is usually interpolated between two illuminants so maybe its this sort of modified DNG that results in the modified outcome?? I have no idea but someone versed at looking at that metadata might be able to say if they see anything that might reflect the visual results??

dt (as of 4.4) only ever uses the D65 matrix, there is no interpolation done for any DNG even it has two.


No, but since it outputs a DNG, it COULD be a metadata difference between input and output.

1 Like

I would think, that after import of the .dng file color calibration module would be the tool of choice to straighten up any white balance issues. Since the majority of this image is really bright, maybe highlight reconstruction also plays a part in this?

Not likely: “highlight reconstruction” only works if one or more of the (raw) colour channels are saturated (have values equal to or above the raw white point). The module then either adjusts the colours so you get pure white, or it tries to use information from the non-clipped channels and the (non-clipped) surroundings to estimate what the clipped area “should look like”.
But in a “proper” HDR image, you should not have hard clipped pixels (bright, yes, clipped, no). So “highlight reconstruction” looks at that HDR image, sees no clipping, and returns to its coffee.

1 Like

Yes, I understand that. To me even the underexposed image did have quite bright areas which might be clipped by one or more channels. But I don’t have the means to check on it right now, so you’re probably right.

Thank you all for your feedbacks!

I also noticed it helped to shift colors, but I don’t know if colors are really shifted after the HDRMerge process, or if it fixes something else by chance :melting_face: I will try with other HDR photos to see if this shift value is consistent across different capture conditions.

I’ve put the play_raw tag so that hopefully some of you will show how they handle (my camera’s) HDR!

1 Like

I have ON1 which does merges… It also has lots of features and default enhancements which I think I was able to turn most of it off and to use their linear raw profile… I downloaded your files and did the merge, pulled back into DT and compared… I don’t think ON1 shows the hue rotation so it might be coming from HDRmerge or the way it exports out its results…

Short video toggling between one of the images and the merged file… note the vectorscope…

1 Like

My version…

DSCF4066-4068.dng.xmp (13.9 KB)

1 Like

I think the image works great even without HDRmerge … :man_shrugging: a great picture btw!

DSCF4066.RAF.xmp (18.6 KB)


Doesn’t look like you have too many stops of exposure difference between the images. When I do 5 2ev stops I get an almost black and almost white frame at each end, and when I merge them in DT or other software they are almost black until I crank exposure to +3/4 and sometimes 5 ev.

When I blend your images the blended on looks almost identical.

Here’s a version of a single shot edit.

DSCF4066.RAF.xmp (34.5 KB)


My Fun