NEF: From where does RawTherapee take input profile "Camera Standard" ?

It would be great if RT (I use v5.6) told me from where it takes the input profile for the current RAW if I select “Camera Standard”. I want to know if it takes an embedded profile, or else which profile it links to.

I know that DNGs contain DCPs, but Nikon’s NEFs are more complicated: Lightroom uses its own DCPs adapted to the manufacturers originals. The result are satisfactory (as good as Lightroom or better) and better than using the ICM extracted with the other method (described here). To compare, I selected “Camera Standard”, and the result was significantly better than Lightroom: more original colors and less noise.

So where do I find the profile RT uses in “Camera Standard” output? Or how do I extract to use it for other RAW converters. Thank you in advance for your help!

I would also like to know which of the alternatives is active for any current image. My tests suggest that it uses the manufacturer embedded matrix for my dngs but it would be helpful to know.

Thanks, these details are helpful!
So now I want to find out what happens in my case: an NEF file from my Nikon D5200 with compressed 14 bit RAW data.
Probably I can find a link to the relevant code. Or RT caches extracted profiles somewhere. (And I cannot find camconst.json within /Library or ~/Library)

Camconst.json is likely inside the app bundle if you’re on a Mac.

I have RawTherapee source code on my computer, cloned from GitHub. The only camera primaries I could find for the D5200 are in dcraw.c, and In, the containing data structure is called “dcraw_coeff_overrides”, so I’m assuming RT pulls them from here. There are no DCP or ICC profiles in rtdata/ for your camera.

Here’s the relevant data from

        "Nikon D5200", -1, -1, // color matrix copied from D5200 DNG D65 matrix
        { 8322, -3112, -1047, -6367, 14342, 2179, -988, 1638, 6394 }

From the comment I would surmise the numbers were taken from the D5200 DCP packed with the Adobe DNG Converter.

From the comment I would surmise the numbers were taken from the D5200 DCP packed with the Adobe DNG Converter.

I don’t believe this. With NEFs in RT I currently use the DCP profiles provided by Adobe CameraRaw, and the results are good. (I guess they are no included because of copyright restrictions?)
But this can’t be the DCP from Adobe since the results are completely different from any of the provided profiles DCPs I use with NEF. Probably someone has calibrated this camera for himself, but then I’d like to get at least a clear comment in the source who/when/how he did it.
The data must have another origin. Converting from NEF to DNG should lead to the same results. I will try for myself converting to DNG and see what options the converter offers.

Anyway, thank you for your help.

I have the Adobe profiles, so I dredged up the D5200 Camera Standard DCP. I did a dcamprof dcp2json conversion to see the profile contents, and ColorMatrix2 has the same primaries:

  "ColorMatrix2": [
    [  0.832200, -0.311200, -0.104700 ],
    [ -0.636700,  1.434200,  0.217900 ],
    [ -0.098800,  0.163800,  0.639400 ]

The illuminant for these primaries is D65:

"CalibrationIlluminant2": "D65",

Now, the Adobe DCP has a “HueSatMap” LUT, so that will play into its application, somewhere.

Point is, absent any LUT or other tone curve shenanigans provided by a DCP or ICC profile, RT (or any other raw converter) is going to use a camera-specific matrix from a big list of such. And probably with a simple power gamma tone curve. It is the tone curve in play that is probably making the difference you are regarding.

Teasing apart the contributions of the camera primaries and the associated tone curve is not a trivial exercise, but you need to recognize the distinction to understand the behavior behind your original question.

I have converted some NEFs to DNG. I still can select within Lightroom the same profiles as the NEF, while an unknown profile was embedded. I have extracted this DCP. Now in RT I have loaded the extracted DCP and compared to Adobe’s Nikon D5200 profile – the result is the same. The converter embeds Adobe’s profile.

Now, the Adobe DCP has a “HueSatMap” LUT, so that will play into its application, somewhere.

I know it is a significant difference not activating all available DCP features. Deactivating the CLUT leads to worse results. But why isn’t this profile fully included and applied when i choose “camera standard” (with this option all subfeatures are selected but cannot be unticked)?

At least this should be shown to the user: Which features are included? I have no real insights in all the parameters of a profile. I just know that there is a color space transformation matrix. Is there a good reason not to include the other stuff into the “camera standard”?

And although this profile is embedded within the DNG, I cannot select “embedded profile”. Why?

In order to support a particular camera, the minimum requirement for raw processor is to have a matrix of color primaries that allow transforming the camera data to other colorspaces. A lot of that data is extracted from the Adobe profiles and incorporated in places like the dcraw adobe_coeff table, or RT’s camconst.json file. Some primary sets are supplied from color target shots, but not many folk have the tools or inclination to make them.

With regard to RT’s use of all the contents of DCPs, I’ll leave that to the devs. I do know that fully supporting DCPs is challenged by the lack of open source programming libraries, in the manner ICC profiles are supported by the excellent LittleCMS library.

1 Like

I believe RT supports nearly all of the features offered by DCP, however - it does not bundle Adobe’s complete DCP collection, I am guessing due to potential copyright issues.

(I’m not sure what the copyright status of basic D65 color matrices extracted from DNG Converter is, but it seems to be common in open source software to maintain that bare-minimum table. For full-blown DCP files, I believe that the ones bundled with RT are restricted to ones generated from user-submitted ColorChecker shots. There is definitely no D5200 DCP in the most recent git master.)

If a DCP file is present and found, it will be “Auto-Matched Camera Profile” instead of “Camera Standard”.