Deliberately difficult gamut colors in macro shot of hex nut

As a companion example to this topic I created, View/Modify color matrix in DCP files , I deliberately shot this extreme macro of a hex nut, 1/4" by 20, lit by incandescent bounced off a slightly yellow ceiling, with a background of pure blue (rgb 0, 0, 255) displayed on an LCD monitor. I had to export as tiff with tamed gamut, and then do curves on that tiff before export, hence me sharing two sidechain files used to get to the final jpeg shown.

Have fun, and feel free to use this in any software development/ extreme gamut image workflow testing.

DSC08363.ARW (23.6 MB)
DSC08363.ARW.pp3 (13.8 KB) DSC08363…tif.pp3 (13.6 KB)

This file is licensed [Creative Commons, By-Attribution, Share-Alike]

1 Like

What a sexy picture.

DSC08363.ARW.xmp (45.4 KB)

darktable 3.2.1

White balance was set assuming the nut was grey, and the top should reflect some of the yellow bounced off the ceiling. Exported srgb relative intent. darktable gamut checker told me the blue background was OOG using linear rec 2020 as working space, but as my monitor can’t display more than sRGB, I don’t notice any difference in the export.


Can’t tell on this medium if you are being sarcastic. Genuinely curious how you meant that.

Interesting image @Waveluke. Would @Ofnuts like images of nuts?

Anyway, I came up with two very different renditions. I managed to keep most colors nicely within sRGB gamut.

Purple hell

Orange and teal

1 Like

It was a joke. If someone asked to create the most garish image possible, then extreme saturation next to dull grey, with an LCD monitor for background and everyday hex nut as subject, would be hard to beat. But the joke is not at your expense - these experiments have value.

I’m pretty sure a picture of some NSFW surgery would be more garish.

More or less pure blue background clipped to sRGB.

DSC08363.ARW.xmp (6.6 KB)

I just achieved an artifactless nirvana of smooth transition, and color detail in the nut using a desaturated color matrix. I was able to do a nice curve, then pipe back in the saturation using L*ab CC curves.

desn.dcp (1.1 MB)


DSC08363.ARW.xmp (13.6 KB)


After my first attempt with brute force clipping, here a more realistic version.

DSC08363.ARW.xmp (7.0 KB)

1 Like

Gee, you sure know how to get to a guy… :laughing:

At first I thought, ‘well, this isn’t such a challenging image, the background is one smooth hue.’ Well, inspection of the nut edges debunked that, so I set out to see what could be done with profiles. First, here’s the image color-transformed with just the libraw-supplied matrix:

I use the matrix profile as a colorimetric baseline; the color gradation may be borked, but the hue should be close to what was presented to the human in the scene. Note that this is the linear data, with only the output application of a sRGB gamma. Any attempt to insert a filmic curve really screwed with the blue hue, pulling it to cyan (troy_s, if you’re listening, here 'tis…) Yep, the nut edges have a distinct ‘border’.

I first looked for a SSF dataset for the Sony A7II, no joy. So, I decided to exercise the dcamprof gamut mapping behavior, where it’ll allow one to apply a LUT that’ll non-linearly pull camera colors into a specified gamut. This is probably the same thing being done in the dt gamut compression, but in my case will be done in the same operation as the transform from camera to display space. So, instead of -p matrix in the dcamprof make-profile command, I used -p xyzlut -t linear -g adobergb-strong. The xyzlut to do a A0toB0 LUT instead of the matrix, -g adobergb-strong is Anders’ starting recommendation to use AdobeRGB as the destination gamut, and -t linear because you apparently have to specify it with the -g parameter instead of getting as default. Here’s the result:

I think those hues in the nut edges have a better transition now. But, I think there’s a slight shift in the overall blue hue; I may have to load this into one of those slider comparision things.

In those oh-so-insightful dcamprof docs, here’s the link to the appropriate passage:

Edit: the dcamprof docs describe gamut compression in the make-dcp operator, but the same switches work with ICC profiles.


So my previous post took care of the blue, but I couldn’t lift the tone away from scene-linear without borking it. Contemplating my navel afterward, it dawned on me that I was using my default toolchain, where I assign the camera profile early but no color conversion is actually done until output, so I was working the image in camera space the entire time. I went back into the gamutcompressed image and added a linear tone colorspace conversion after demosaic and scaling. I tried ProPhoto, Rec2020, but the best result, the one that minimized hue shift in filmic, was converting to linear sRGB. The hue still shifts a bit, but not as bad as the others:

There, now the nut looks better… :laughing:


Oh, how I miss BattleBots and their Giant Nut (and Robot Wars).

Oh, a bit about the profile creation. I’ve had good success using the ColorChecker included in the studio comparison raws from dpreview:, in whichever box you choose, select the camera of interest, select RAW and the base ISO, and click the raw link at the bottom where it says Download. I then open the raw, apply black subtraction, white balance, demosaic, then crop out all but the ColorChecker. Save that as a 16-bit TIFF and do the Argyll scanin/colprof, or scanin/dcamprof dance to make whatever profile you desire.

Here are the Sony A7II profiles I made for this exercise:

sony_ILCE-7M2_lut-gamutcompress-adobergb-dcamprof.icc (212.5 KB)
sony_ILCE-7M2_lut-gamutcompress-adobergb-strong-dcamprof.icc (212.5 KB)
sony_ILCE-7M2_lut-gamutcompress-srgb-dcamprof.icc (212.5 KB)
sony_ILCE-7M2_matrix-dcamprof.icc (524 Bytes)

1 Like

ART dcp profile, tone curve

On my display I can see the blue as displayed by ART, but it seems clipped by the sRGB output profile.
When using a wider gamut output profile, the output is correctly displayed by xnview or by firefox. But when uploaded here, it is again clipped. So what you see is not what I can see in xnview or firefox.

If you click on the image, you will get a different blue that is better.

1 Like

DSC08363-Nut-S-sRGB.xmp (39.5 KB)
Done in dt. I don’t understand what’s happening here… can anyone explain pls… See Color Balance 1 module. It’s affecting parts of the image not included in the mask. Or so it seems…

attempt #2. Getting rid of the fringe is clearly all about the input profile. Here I’ve used linear infrared BGR. This makes the background orange, so I followed with channel mixer, swapping the red and blue channels.

DSC08363.ARW.xmp (54.7 KB)
darktable 3.2.1


Filmulator makes a nice indigo shade.

Drama 90, white clipping point 0.636.

1 Like

@Waveluke can you give an indication as to whose colours look most similar to how your eye saw the scene?

Wow these are great.