My Nikon D800 camera apparently records colours that are outside the horseshoe of a CIE xy chromaticity diagram. For points that are beneath the “line of purples”, this can be explained if the camera can see ultraviolet and infrared frequencies. But points outside the curve of monochromatic colours? I thought those points didn’t represent colours at all.
I took a bunch of *.NEF files from a Nikon D800 with various lenses. dcraw de-bayered and converted to XYZ, ImageMagick converted each to xyY, and made a scatterplot from (0,0) to (1,1) that is white where any of the pixels translates to that xy, otherwise black. I superimposed the CIE horseshoe in red on top. The script is shown below.
Why do some pixels translate to xy values that are outside the horseshoe curve? Possible hypotheses are:
I’ve made an error somewhere.
My understanding is wrong, and we should expect values outside the horseshoe curve because …
The dcraw conversion to XYZ is wrong.
The dcraw conversion to XYZ is correct only for some photos. I think it’s a simple 3x3 matrix. Perhaps for accuracy it should be a more sophisticated transformation, or a different 3x3 matrix made (eg with a colour chart) for each lighting condition. (If it needs different matrics, why?)
If the answer is (3) or (4), can I expect a more accurate transformation from other raw converters, eg RawTherapee? Or is something on the horizon to increase sophistication? Perhaps something can be added: if any pixels are outside the horseshoe, adjust the 3x3 matrix automatically.
The Windows BAT script, which uses dcraw and ImageMagick build with my process modules, is:
rem %1 is directory containing *.NEF files. rem Subdirectories will be searched. set FILELIST=\temp\nefg.lis set TMPXYZ=\temp\ng.tiff set TMPOUT=ng.miff set OUTFILE=ng.png %IM7DEV%magick ^ -size 512x512 xc:Black ^ -define quantum:format=floating-point -depth 32 ^ %TMPOUT% @for /R %1 %%F in (*.NEF) do ( @echo %%F %DCRAW% -v -4 -w -W -o 5 -T -O %TMPXYZ% %%F %IM7DEV%magick ^ %TMPXYZ% ^ -strip ^ -set colorspace XYZ ^ -colorspace xyY ^ -set colorspace sRGB ^ -process 'plotrg dim 512 verbose' ^ -flip ^ %TMPOUT% ^ -compose Plus -composite ^ -define quantum:format=floating-point -depth 32 ^ %TMPOUT% ) %IM7DEV%magick ^ %TMPOUT% ^ -fill White +opaque Black x.png call %PICTBAT%cieHorseshoe x.png nefGamuts.png