Categories
Questions

Question #19: What the F*ck is a “Gamut”?

Phew. It’s been a long time coming, but the time we have invested is starting to pay off! We can actually discuss colour in a meaningful way, and with the introduction of perceptually uniform maps with Question #15, we can even compare colours or get a sense as to “how different” chromaticities are! And we’ve just started scratching the surface of how different displays behave with Question #16.

Hopefully, with the sorts of questions answered since then you are beginning to appreciate why understanding the various chromaticity diagrams and their relationship to visible light are the most important set of concepts a digital artist needs to know; it allows us to discuss colour in a meaningful way. As a set of core concepts they are, in no uncertain terms, the ground truth for all things creative from print to display to rendering to photography to motion graphics to whatever little unique domain has found you here, reading this crap.

So you’ve heard about gamuts. You might even be staring at something someone or some marketer described as a “wide gamut” display right now! As is a familiar in this series, we are here to figure out and investigate exactly what “gamut” means

Question #19: What is a gamut?


By focusing on physical things like displays and lights, we are able to give meaning to the nebulous concepts and keep the meaning out of the abstract bulls*it quagmire of “colour spaces”. While a typical image hustler has no problem understanding that one of the three tiny and specific coloured lights in their display increases or decreases in emission, the ideas around transfer functions and chromaticities are tricky things to expect someone to “grab on to”.

Why are we rehashing these two darn things again? Because for the answer to our question, we are going to need to hyper focus on transfer functions and chromaticities. Let’s keep the following concepts fresh in our heads:

Transfer functions are the Rosetta Stone between encoded RGB code values and physical quantities of light.

A chromaticity is a strict and absolute definition of a mixture of the most pure, laser-like wavelengths of visible light relative to a standard observer.


Let’s look at what the experts in the field of colours science have to say about the term gamut. It is the first few words that we are going to focus on:

volume, area, or solid in a colour space

Colour gamut definition from the CIE term list

For our purposes, we can get a sense of the “area” portion of this definition having covered a couple of very useful models and their respective diagrams. While we will keep our discussion grounded in something that pixel pushers all over are familiar with – a piece of display hardware – the general principles apply for the larger umbrella of colour spaces across different mediums, including print and other reflective media.

We already have discussed two reliable methods to discuss and plot “colour”1 via either the non-perceptually uniform chromaticity diagram from Question #13 or the perceptually uniformly scaled variant in Question #15. Let’s look at the area differences when comparing an sRGB display versus an iPad Pro again:

FIGURE STUPID AREA COMPARISON: A comparison of the areas formed between the three lights of an iPad Pro (Display P3) and a typical display (sRGB). Remember, the specification that sRGB uses to describe the chromaticities of the three primary lights is taken directly from another standard in BT.709.

As useful as this diagram is in comforting you that your two thousand dollar display is “better” than your friend’s cheaper display, we can also see that it has limitations. While this variant shows us a two dimensional plot of colour mixtures, we explored in Question #18 that it leaves out one crucial and vastly important aspect. We are missing the range of intensity that visible light mixtures can be displayed at!


First, let’s knock the answer out. The CIE seems to have a very clear and useful summary solution, so let’s roll with that…

Answer #19: A gamut is a volume, area, or solid in a colour space.

But what does that really mean? What does it look like? To answer that, let’s take a peek at a generic image.

FIGURE SAMPLE RGB: Seems fitting enough

Given we’ve spent more than enough time diving into chromaticity diagrams, let’s see what the above image, including the “white” text, looks like as a volume of colours expressed in the CIE 1931 xyY model…

Plot of the sRGB triplet values using the familiar xyY chromaticity diagram. This stupid thing took about three hours to render using the completely unoptimized plotting tools of MatPlotLib.

So what exactly are we looking at?

The above 3D plot maps every single pixel in the above sRGB FIGURE SAMPLE IMAGE and transforms the sRGB values properly to xyY. That means several hundred thousand pixels are plopped into the xyY model, and the above animation shows us the volume of colours in the 3D chromaticity diagram. The upper most white circle in the plot? That is the position of the white text pixels, all crammed into the exact same 3D xyY plot position, because… well… they are all the same chromaticity. The darker scattering near the sRGB triangle footprint? Those would be the extremely low intensity emissions near black in the image. If we were able to see through the cluster of points near the bottom, we’d find a single value representing the sRGB chromaticity point for [0.0, 0.0, 0.0]. The rest, as you can see, are quite orange-y to red-y to brown-ish looking, and map according to intensity along the vertical axis.

So if that oddly mountainous looking stack of chromaticity positions is indicative of the FIGURE SAMPLE IMAGE‘s pixels, what might the extremes of the sRGB gamut look like? Wait no further for the question that you never wanted to know the answer to!

The question you never asked nor cared about! The entire exterior solid hull shape of the sRGB gamut volume expressed using the CIE 1931 xyY model.

And that brings another installment to a close. Although there are several useful representations of gamut available as per the CIE defintion, we have highlighted the idea of gamut as a volume here. To appreciate why we have focused on gamut as a volume of values however, will have to wait for some further questions…


1 Always remember that the chromaticity plot only plots a direct connection between visible wavelengths of light and the limited experience of “colour” for a standard observer. While we might be loosey goosey with our terms at times, it is always important to draw a distinction between a chromaticity as a useful coordinate mapping and the more complex sensation of colour. We can use the former to reference loose ideas of the latter, but there is a nuanced and complex differentiation between the two terms. Colour, in the larger psychophysical sense, is hugely complex and contextual.

6 replies on “Question #19: What the F*ck is a “Gamut”?”

What the f*ck is a negative primary and how can a camera’s photosite respond to and encode an impossible color?

Also what the f*ck do I do with it as a colorist?

Like

Solid question. It’s nonsense!

> What the f*ck is a negative primary

In a Cartesian model, a negative is effectively outside of the domain. It flips the universe upside down as it crosses over to below zero.

Out of domain values have no meaning with respect to the destination. That’s a key point that is often overlooked. A triplet coordinate that is beyond domain is quite literally meaningless / without meaning.

Could a value in DCI-P3 hold meaning that is meaningless relative to BT.1886? Absolutely! And **that** question has never actually been tackled beyond the goofy and endless discussions of “gamut mapping”. None of which actually pose a clearly delineated solution to ill defined problems. It’s always number fornicating and validating the results against some other dubious metric.

> how can a camera’s photosite respond to and encode an impossible color?

The camera sensor is nothing at all like our colour cognition mechanisms. It’s just a dumb absorptive sensor with dumb attenuating filters applied. This is effectively a band pass arrangement.

Those quantal catch counts are meaningless at this point. To create “meaning”, the quantal catch counts are “fit” using some undisclosed math fornicating, to match “known” values. Commonly, the blunt force 3×3 matrix approach is used.

Think of a sheet of clear latex that we can stretch. We mark the latex with known cities around say, the UK, in an approximate position as to where we thought they were. Then we take a 2D map and stretch our latex, pulling only three points, to align to the “actual” positions. We’d never get them ideal, but we could get them close.

The problem of negative values is that if we included the cities in the UK, but also some cities further away from the UK on our stretchy latex, such as Paris or even New York, as we prioritize fitting to the UK, we might stretch the latex such that Paris and New York are still quite misaligned. Worse, we end up stretching the points of the latex to positions off the map in order to stretch the positions to line up.

Those stretch points off the map? Those are the primaries; way off in meaningless map domain land.

This is a goofy analogy, but if we swap out the cities in the UK with a ColorChecker 24, you can sort of see how these approaches accumulate “errors”, and we can end up with negative primaries.

> Also what the f*ck do I do with it as a colorist?

There are no solutions and the problem is ill defined.

Generally speaking, the “problems” we tend to see when thinking about pictures is that negatives are not even zero, but often flake out all of our computer math leading to really mangled up outputs. Picture formation and the theory is still in the proverbial dark ages, and negative values cause massive posterization in formed pictures, or explode algorithms designed for valid domains.

One approach is a simple clip. Clipping a *negative lobe* has the fairly unintuitive result of *increasing* the emission strength of the remaining channels. The negative lobe literally “subtracted” from the other gains. The result in many picture chains will increase the magnitude of the other channels, and this can lead to disruptions in the formed tonality. In some picture formation chains, this is less of an issue. For example, it is the default approach I applied in the Resolve AgX demonstration, and it is actually remarkably tricky to spot. There are errors in the Resolve AgX approach, but many of the common errors are negotiated due to the mechanics.

So to answer:
1. Choose a picture formation chain that doesn’t stink. Good luck with that. Some exist, but most folks aren’t even aware of the tremendous implication of the picture formation, let alone even aware of where it exists in a chain!
2. If the picture formation chain yields a picture that is cognitively disruptive, it is feasible to “correct” some of the values using something like tristimulus warping tools. Resolve has one, and Baselight offers Grade X for such things.
3. Absolute worst cases can be sorted by avoiding the colourimetric transformation and starting from the untransformed RGB. All values will be valid domain, and then the colourist can warp the RGB to align with their goals.

Key takeaway; the picture formation chain should do everything in its power to provide you with a well formed picture, regardless of input colourimetry. Sadly we aren’t there yet.

The worst part in all of this is that the very stage to “align colourimetry” is the thing that creates the problems. Given that the picture forming discards the colourimetry anyways, the whole thing is a goofy mess that gets in the way of colourists attempting to form wonderful pictures.

Like

The fact that equal mixture of chromacities doesn’t lie exactly in the middle of them broke my world. For some reason ever since I’ve read “…diagram is actually another “linear” plot. That is, the plot is radiometrically uniform with respect to an observer…” in the question 15, I implicitly assumed such simple mixing would be possible.

Just to make sure I don’t make any further incorrect assumptions:

a) If I take any (somehow normalized) light spectrum that results in chromaticity with coordinates (x_1,y_1) and some other spectrum (normalized to same value) that results in (x_2,y_2), is it guaranteed there is some well defined point (x_3,y_3) with same chromaticity as the one that would be assigned to the light that is created by physically mixing those lights? Maybe the answer is “obviously yes, that’s why the model was created in the first place” but I don’t feel like now I’m sure about anything. (I intentionally wrote “somehow” normalized because I don’t know how, if it should be by radiosity or luminance or something else.)

b) What does the plot being “linear” mean if I can’t just do some linear combination of two points to get their mixture? Is there some special property I can count on, or is the diagram completely arbitrary and I can’t make any assumptions? (Or is my assumption wrong and I can somehow meaningfully do linear combinations of points?)

Like

> The fact that equal mixture of chromacities doesn’t lie exactly in the middle of them broke my world. For some reason ever since I’ve read “…diagram is actually another “linear” plot. That is, the plot is radiometrically uniform with respect to an observer…” in the question 15, I implicitly assumed such simple mixing would be possible.

It *is* linear-with-respect-to-stimulus-energy, but that is “broken” in CIE xy thanks to the normalization of the “sum” signal. That normalization over the sum is what disrupts the underlying CIE XYZ, which *is* entirely uniform with respect to energy. EG: 50% of CIE XYZ A “mixed” with 50% of CIE XYZ B is indeed right in the middle, but when we reproject to the normalized CIE xy plot, we lose that third dimension.

> a) If I take any (somehow normalized) light spectrum that results in chromaticity with coordinates (x_1,y_1) and some other spectrum (normalized to same value) that results in (x_2,y_2), is it guaranteed there is some well defined point (x_3,y_3) with same chromaticity as the one that would be assigned to the light that is created by physically mixing those lights?

100% correct. And in fact, if we take 0% of x_1, y_1, and 100% of x_2, y_2, we are at 2. And as we increase the ratio in terms of the origin CIE XYZ that lead to the CIE xy coordinates, we are basically linearly interpolating between 2 and 1.

> if it should be by radiosity or luminance or something else.

The best way I have found to think about CIE XYZ and it’s children including CIE xy, is that it is broadly the lower order relationship between current / stimulus energy to neurophysiological signals. It is deadly important to realize however, *that this is not in any way “colour” and anyone who forwards such a vantage is horribly mistaken*.

The base “unit” between values in the CIE XYZ model *could* be considered “one unit that corresponds to one unit of luminance”. That is, if we increment along the Y dimension, we are incrementing luminance in the literal sense. X and Z, while being closely linked to the “chrominance” signals, are also uniformly related to Y.

> b) What does the plot being “linear” mean if I can’t just do some linear combination of two points to get their mixture?

I have come to be wary of the term “linear” in the past few years. I feel it is overloading terms that different folks use. I have preferred to say “uniform with respect to …” in order to define relationships. In this case, the CIE xy plot is really a reprojection of the CIE XYZ model. The CIE XYZ model is “uniform with respect to current” if you will. That is, it’s a workable connection space to the lower order neurophysiological signals. However, we erroneously hear folks speak of “colour”, as stated above, and nothing could be further from the truth. Colour is cognition, and the cognition happens further upstream of the stimulus or the lower order neurophysiological signals.

> Is there some special property I can count on, or is the diagram completely arbitrary and I can’t make any assumptions?

It’s probably healthy to think of the diagram as being rather arbitrary due to that peculiar reprojection normalization. It is a very wise vantage to be skeptical of the diagram as a map, as the map leads to all sorts of erroneous inferences due to our nature of understanding maps and territories. Heck, even the underlying CIE XYZ model has huge fallacies of understanding that flow from it!

> (Or is my assumption wrong and I can somehow meaningfully do linear combinations of points?)

It might be helpful for one to try a linear mixture of CIE XYZ coordinates and then normalize the values manually to CIE xy. Once one tries this a few times, it becomes a wee bit clearer the connection between the “real” CIE XYZ and the reprojection of the CIE xy diagram.

Hope this helps?

Like

Thank you for reply. I did some additional reading and experimentation and I think I have little bit better understanding.

The XYZ is the “original” model and it’s the one better suited to do maths on, while xyY is derived from it.

I was bit confused what’s the point of everyone drawing xy diagrams instead of something like XZ. I’ve tried to create my own XZ diagram, as I couldn’t find any online (it’s hard to tell search engines the difference between uppercase and lowercase). I’ve tried the colour-science package you have recommended in one of your posts, but I ended up just using simple python crypt to warp xy diagram from Wikipedia. Long story short, it ended up looking horribly deformed. Either I have some bug in my code, or I get why people don’t use XZ diagrams. I saw pictures like [this](https://spatioplotter.com/color3d/images/screen%20shot%202017-03-27%20at%2084050%20pm.jpg?crc=4084979851) and I have assumed the distortion would look way less severe.

X and Z being depended on Y don’t seem like huge problem for me, that would just mean that the whole space would be slightly slanted. But looking at the equations from Wikipedia ( X=Y/y * x, Z=Y/y * (1-x-y) ), it looks like the non-normalized values can be quite arbitrary and they’ll explode in the purple region (where x and y are small) to some huge values (that’s also what happened in my experiment). (I’m assuming the xyY values are between 0 and 1.) Is that correct or am I missing something?

Like

Some very nuanced territory here in trichromancy. There Be Dragons!

The XYZ is the “original” model and it’s the one better suited to do maths on, while xyY is derived from it.

Indeed. The xyY model passage by Giorgianni is likely something that should be appended to every single plot that shows the values because of this.

I was bit confused what’s the point of everyone drawing xy diagrams instead of something like XZ. I’ve tried to create my own XZ diagram

Indeed! The nuance of the X to Z dimension is that is broadly correlates to the underlying neurophysiological signals that contribute a disproportionate amount to the notion of “chromatic” cognition. How? No one really knows. A key nuanced point that I’d bring up given you are knee deep into nuance at this point, is that the underlying neurophysiological signals are not “quantities” in the sense that the XYZ model might lead one to believe. That is, the biology is differential in nature, via a pooling and subtractive mechanism. Further, the “actual” biology of the cellular assemblies are not simply the Protan (L), Deutan (M), and Tritan (S) absorptive profiles! The pooling consists of unique combinations of those absorptive profiles. TL;DR: When someone draws an inference between XYZ and “Oh our eyes are a sensor” they are drawing utterly the wrong conclusion that will set them up for foundational misunderstandings.

The more direct answer that you might appreciate is that the X and Z signals can be deduced in terms of a “uniform contribution to position on the plot” by:
* Dividing out the achromatic centroid XYZ. EG: Divide out the D65 XYZ “white” value, normalized to unity.
* Gain the X and Z by Y by dividing by Y. X/Y and Z/Y.
* Know that the “luminance” signal “balances” against the X and Z signal vector. That is, using 1.0 – X and 1.0 – Z will lead to a proper uniform-with-respect-to-luminance distance metric for X and Z.

That’s worth exploring. I’d not utter this were it not for your spelunking, so blame yourself. 😉

Is that correct or am I missing something?

It’s worth remembering that all of this was a model fit by way of an extremely limited and niche experiment, of which the veracity is at least contested on a number of fronts. While it is a “stimulus” specification, we cannot escape the cognitive quicksand; the idea of “achromatic”, which is an incredibly important facet of the model, is indeed cognitive, and therefore draws in all of the cognitive soup into this. That said, it’s worth following some basic principles:

* The total adapted achromatic cognition can be considered stimulus energy S.
* Any and all “purer” values are less than S. That is, we decrease stimulus energy as we increase purity. Basic integral stuff here. Whatever and however the cognition mechanic works, we can at least assert that whatever it is we are adapting to, it will be an attenuated, due to absorptive profiles, version of S. Let this be called N.

As such, we can know that things that are neurophysiological in essence, they’d be some combinatorial subset of N. That is, as we increase “luminance”, which is plausibly the sum of the P and D absorptive signal, we implicitly will reduce purity. And we know the opposite to be true; in order to increase purity, we must somehow “swing” the cognitive differentials toward a more “pure” neurophysiological signal, thereby reducing luminance. Think in terms of reflectance and absorbance and we can probably get a sense of at least one reasonable evolutionary tract here.

All of this is to more or less suggest that in a global frame “balanced” system of achromatic such as RGB, and we start with R=G=B as our base, the sole way to create a “more pure” stimulus is to reduce a given channel from that R=G=B entry point. In doing so, luminance goes down, and chrominance, or that combined twin vector magnitude hinted at above, will increase.

Phew… enough of this janky jank for now!

Like

Leave a reply to Peter Cancel reply