Bright lights in Nikon raw image appear magenta in darktable

I’ve encountered a strange issue today where many of my NEF files have a bright magenta tint to areas of high exposure.
Not sure why this is happening or what the issue is.
I hope someone here is familiar with what may be going on and I would really appreciate assistance on figuring out if there’s an issue with my camera or not.

The originals also still have the issue as well:

They don’t have this problem when I look at them from the camera itself, from the lighttable view, and from Apple Photos.


  • darktable 4.8.1
  • Nikon D3100

Hi, welcome to the community.

This is what happens when your highlights are clipped. Enable the highlight reconstruction module.

1 Like

Thank you, and thank you; that was it!

That module is enabled by default; it was step #7 in the history. So why didn’t it fix the blown highlights?

Sometimes I have to lower the threshold a little to get rid of the magenta highlights from the highlights reconstruction module. This is very rare, but certainly happens.

The threshold it came up with in that step was too high, so I needed to decrease it.

1 Like

Also, I used to have the highlight reconstruction module included in my style (preset package), with specifically configurated settings. It took me some time (and a lot of “need to lower the threshold” corrections in the highlight reconstruction module) to notice that the raw black/whitepoint module had to be set on “reset” in the style settings. Otherwise it would imprint the settings of the original picture (from which the style was created) on all others upon which it was applied, often using wrong values.
But I guess that in your case it was not necessarily because of style settings.

1 Like

I would never recommend this - to use presets with highlights and rawprepare. Only do this a for a specific camera and specific ISO. The fefaults are “best” in almost all cases.

I am not aware of any nikon camera that requires setting changes for highlights. Would you be able to share this raw image for analysis?

There are very few images from cameras with bad firmware, some sonys were problematic.

4 Likes

Sure. And just to clarify, I mean that after the filmic scene-referred workflow is auto-applied, I need to reduce the highlight reconstruction threshold from 1 (what’s set in the workflow).

Here’s the raw from this discussion:

_DSC0134.NEF (11.1 MB)

It appears some recent photos I’ve shot also ended up severely overly exposed somehow and are also facing the same clipping issue. The overexposure doesn’t look like something I can’t recover any detail from.

For lower light scenes, I don’t have apparent issues at all, however.

I took a quick look in one of the RT configuration files…

The exif data in your file doesn’t specify the raw wp but it looks like a 12 bit file so RT comments that for many Nikon camera’s it uses the 14 Bit wp including the D3400 which was the closest model I could find to your D3100 listed in the camconst file…

WL12 = WL14*4095/16383 (They use 16300 for WL14 to be safe)

Based on that it seems RT would use something like 4074 for a raw wp… it was a bit lower in DT.

THose are all rough numbers but if the raw WP is off just enough then this is when you see the issue with having to tweak the threshold to get the HLR to kick in and do the correction.

I did a bit of an edit that likely killed the original light but I just left DT wp alone and went to clip highlights instead and then did a quick edit… you didn’t specify a license but here is the xmp for your reference… That mode or dropping the threshold for HLR seems to compensate for the artifacts…
_DSC0134.NEF.xmp (13.7 KB)

1 Like

Thanks for providing the raw.

And indeed, this is a file with wrong white/black points so

  1. for now you might define a rawprepare preset for the 3100.
  2. dt should take care of this.

For me it seems we would want a higher blackpoint in all channels ~30 and a whitepoint ~3800. Please remember the highlights module button beside the clipping slider, that might help you here.

EDIT: An easier way would be a preset for highlights with opposed clipping at 0.98

2 Likes

Wouldn’t a better solution be a preset for raw black and white points with the values you mentioned (~30 and ~3800, resp.)?

Presets for rawprepare would mean to check all iso. Here the highlights preset would be fully sufficient i think. (Maybe the highlights module could do more checking …)

Thanks for all the clarifications. I also have a d3100 and have the same issue. I’m still learning DT, so very very helpful

And if you use sigmoid instead of filmic RGB, you can get better result easily with Nikon files.

Each has its advantages. Filmic is more flexible, but can produce salmon sunsets and sunflowers. Sigmoid is simpler, handles yellows and oranges better, but often loses contrast and/or saturation in highlights. It has nothing to do with Nikon or not (one of my cameras is also a Nikon).

The desaturation of highlights in sigmoid (which can also be achieved with filmic) hides issues with blown sensor data (when they are not properly handled in highlight reconstruction), but is more of a workaround than a fix.

2 Likes