RT using dcraw instead of camconst.json for DNG

Hello everyone! I am here to ask yet another question about how rawtherapee works. With verbose active, I am looking at how RT retrieves information such as black/white levels and color matrices from camconst.json. I am currently working with a .nef image and a converted .dng of the same photo. When I load up the .nef in RT, I can see it found the correct camera “Nikon D3400” listed in the compatible cameras in the camconst.json file. It retrieves all of the information it can from camconst.json. But when loading up the .dng counterpart in RT, it says it found the camera in the camconst.json, yet it uses information that originated from dcraw and contains different values compared to the camconst file. I will paste below what it returns to me. Is there a known reason as to why it behaves like this? I am not 100% confident this is where my problem originates, but it is a bit confusing to me as to how this is happening.

NIKON NEF:
Loading Nikon D3400 image from Nikon-D3400-raw-00006.nef…

constants exists for “Nikon D3400” in camconst.json

black levels: R:150 G1:150 B:150 G2:150 (provided by camconst.json)

white levels: R:4075 G1:4075 B:4075 G2:4075 (provided by camconst.json)

raw crop: 0 0 6016 4016 (provided by dcraw)

color matrix provided by camconst.json

ADOBE DNG:
Loading Nikon D3400 image from Nikon-D3400-raw-00006.dng…

constants exists for “Nikon D3400” in camconst.json

black levels: R:0 G1:0 B:0 G2:0 (provided by dcraw)

white levels: R:4095 G1:4095 B:4095 G2:4095 (provided by dcraw)

raw crop: 0 0 6016 4016 (provided by dcraw)

color matrix provided by camconst.json

Currently, yes. See e.g. dcraw: prefer raw crop and mask from dng metadata by sgotti · Pull Request #7016 · Beep6581/RawTherapee · GitHub

Some programs generate dngs that require different black and/or white levels than the non-dng raws. That’s why RawTherapee will use the black and white levels in the dng metadata. The exception is if the dng is from the camera. Pentax is a good example. I can dig up the discussion about this feature if it interests you.

1 Like