Deliberately difficult gamut colors in macro shot of hex nut

I spent the afternoon making a better chromaticity plot. Learned a bit of python, ADSL: Another Damned Scripting Language. Anyway, that’s the lingua fraca of Colour, a color analysis tool. It pukes a chromaticity plot and provides the functions to plot data upon it. I wrote a function to parse exiftool primaries, and got this:

plot

These are the matrices for a Nikon D7000 from three sources:

  1. ColorChecker target shot processed by Argyll/dcamprof;
  2. Spectroscope-measured SSF processed by dcamprof;
  3. The Adobe Camera Standard DCP, converted to ICC with dcamprof.

Of note is that they’re different. Similar, but different. I’ve tested each with my “regular colors” test image, and there is no perceptible shift in colors. The max dE for the SSF and target profiles is about 2.8; the max dE for the Adobe matrix is 3.23. But of note, the Adobe profile handles the blues in my theater image a bit better. Indeed, here’s a render of the nut processed with the Adobe matrix:

My surmise is that Adobe “scooches” their primaries from colorimetric to handle extreme blues… ??

1 Like

Yes, Adobe does tend to scooch. :dancer:  Edit I think this is where LUTs come in. According to @jdc, RT uses many (I guess to place colours in the right places).

1 Like

Throughout this discussion I’ve been thinking LUTs as input were an alternative to the matrix, but it seems that understanding is not correct. Is it more correct to think of them as an alternate to rendering intent? Instead of relative, perceptual, etc… you use a LUT?

Not sure how up to date this is or whether this is relevant to our discussion:
http://rawpedia.rawtherapee.com/Color_Management_addon#The_.22Munsell.22_correction

In ICC-land, LUTs are how Perceptual and Saturation rendering intents are implemented. Matrix profiles rely on straight-up linear algebra to do the transform, but the same colorimetric transform can also be implemented in a LUT. Back in this post Deliberately difficult gamut colors in macro shot of hex nut - #53 by ggbutcher is a link to a really good explanation of this.

A matrix profile allows very good hue preservation; it’s where the destination of an out-of-gamut color ends up that vexes it. Scooching the primaries around can heal certain things, but if not carefully done will damage others… Another good passage from the dcamprof doc on this: DCamProf

To quote myself:

Re-reading the thread, I can see that to be the correct interpretation:

My bold. From this I deduced the gradation was in the LUT - used as input profile - not the rendering intent. (Meaning a LUT as input profile would give different results to a matrix profile with ‘perceptual’ intent) Unless the LUT included the rendering intent - and the gradation was in fact the result of the rendering intent. Which is the correct interpretation?

Again, to me it suggests LUTs are not just used as rendering intents, but input profiles - an alternative to the matrix.

@gaaned92 I have quoted the above in hope it explains my answer to you.

The confusion comes because you mentioned a LUT that came in addition to the matrix, whereas ggbutcher was talking about LUTs instead of the matrix. When you said ‘in addition’ were you referring to the perceptual/saturation rendering intent LUTs? Were you mistaken? Or is there some matrix+lut combo (other than rendering intents) I have somehow missed through all this?

Appreciate the time everyone is giving.

A LUT is just a lookup table that converts some input value to some output value. A matrix is doing a similar conversion, but in a strictly linear algebra fashion. If you fill the LUT with the same values as you would get from the matrix conversion, it behaves identical to that matrix.
So, a LUT can replace a matrix, but a LUT can do more (non-linear stuff).

3 Likes

@afre
Yes RT uses about 190 LUT to convert “Lab” to “Munsell”, when user change L*, a*, b* (change of Ligthness, saturation, etc.)

The main color concerned are blue/purple (big differences) , red/yellow, and also green

jacques

Many ways to skin a cat but, if the typical input pipeline is followed (e.g. that in the DNG spec), a 3x3 matrix interpolated based on Correlated Color Temperature is used to go from camera to XYZ (1). Then another 3x3 matrix is used to adapt to the white point of the working/output color space (2); then another 3x3 matrix is used to project to an output color space like sRGB (3). The three (or more) matrices can be combined into one if no LUTs are applied.

While in XYZ errors and non-linearities may be corrected via one or more LUTs or otherwise. Adobe until recently used two LUTS: a ‘base’ LUT to get the tones in the colorimetric ballpark, followed by a ‘look’ LUT to give pleasing results based on the scene (you know, ‘Landscape’, ‘Portrait’, ‘Standard’ etc.). If you have a dcp profile loaded in RT you can see what effect they have by turning LUTs on or off via the relative check boxes in the color management tab. More recently Adobe has been desaturating the matrix in (1) above to make sure no tones are left behind - to then make up for the desaturation via the base LUT, so we lost the step with a colorimetric baseline.

BTW the LUTs are applied in HSV space via a detour to ProPhoto RGB and back. So after matrix (1) above: XYZ to ProPhoto (3x3 matrix), convert to HSV (non-linear), apply LUT (3D interpolation), convert back to ProPhoto (non linear), then back to XYZ (3x3 matrix) and on to the matrix of step (2) - or something similar. Most of this happens in floating point these days.

A bit more convoluted than first suspected, right? Such is the state of Color Science today.

Jack

1 Like

Well, that makes me feel a little better being confused about these things. Time to stop asking questions now… haha. At least I have a much better understanding about what’s going on then I did a few days ago. Thanks very much for the explanation.

You’ve got good explanation above, just thought I’d try to put it into context…

A rendering intent describes the behavior of a transform. That transform could be with a matrix as the input condition to the matrix math where the rendering intent is enforced, or it could be with a LUT that has rendering intent behavior “baked” into it.

In ICC-land, @gwgill"s gamut mapping treatise describes their implementation of the rendering intent mechanism. And of note, a colorimetric intent can be baked into a LUT, but a perceptual intent cannot be accomplished with just a matrix. At least in ICC-land… oh, and note the notion of a defined ‘rendering intent’ is an ICC-ism…

In DCP-land, I’m a bit less informed, but they don’t seem to define ‘rendering intents’. They do seem to use a combination process, where the matrix provides the colorimetric part of the transform and one (or more?) LUTs can subsequently adjust the data to various objectives. (Edit: Oh, should read more before posting, @JackH give a good step-by-step, above. Reading that, I don’t think I’ll ever implement it… :laughing:)

In ACES-land, their whole ingest workflow is about an IDT (or IT, as they’ve redefined it) to ACES2065-1, which is the reference colorspace for archiving and further work. From what I’ve read to date, I think it’s strictly a colorimetric transform supported with SSFs where available (I don’t yet know the specific mechanism), but in rawtoaces they fall back to the libraw-provided dcraw-style primaries if not.

In dcraw-land, there are just camera primaries, and a single matrix math transform is done straight from there to one of six colorspaces, with what looks to be an absolute colorimetric intent. Picking through dcraw code is quite challenging; if someone knows more about this, please speak up.

As @JackH says, “many ways to skin a cat…”

1 Like

Should ProPhoto be linear rgb ?

Good point, all of the color transforms above happen without ever applying gamma. The relative matrices take us to and from the linear non-gamma version of the desired RGB space (with the DNG spec ProPhotoRGB to apply LUTs, often AdobeRGB or sRGB for output). Once settled into the final color space the appropriate gamma is applied (as late as possible).

Just let it roll around in your mind for a few days, then come back to it!

1 Like

That’s how the dcamprof documents work for me: read a bit, consider it, mess with it in rawproc, put it aside for a few months, rinse and repeat. I’ve been picking at them for a couple of years now, and there are things I have failed to understand until this thread…

3 Likes

Glad I could help everyone learn together.

3 Likes

Makes me wonder if there is a comprehensive ‘textbook’ for in to the weeds color theory.

@Waveluke Google Scholar? Found a few good books that way. Trouble is finding a physical or digital copy to read.

Yeah, the strange thing is any books I find just by googling tend to seem more geared for casual photographers and artists than what I want.

I have the opposite experience. I find advanced books that no one carries and when I look at the prices direct from the publishers I see $$$ which is a nonstarter.