Wednesday, September 6, 2017

Interpreting color difference data - a practical discussion of the CRF

My avid readers (yes, both of you) will realize that I have been on a mission, a holy quest, for process control of color. The holy grail that I seek is a technique for looking at the color data of a color-making process, and distinguishing between normal and abnormal variations in the process. This is subtly different from setting acceptance tolerances. The first is inward looking, seeking to improve the process. The second is outward-focused, with the ultimate goal of getting paid by a happy customer.

I'm not talking about getting paid. Unfortunately, getting paid is rarely the outcome of this blog!

In this blog post, I talk about a tool for color geeks. This tool is appropriate for analysis of whether the color is acceptable. I will discuss whether this tool is acceptable for identifying changes in the process. I promise to write about this tool for customer satisfaction later.



Recap of exciting events leading up to this

Just to recap, I wrote a lengthy and boring sequence of blogs on statistical process control of color difference data. The four part series was aptly called Statistical process control of color difference data. (Note that the link is to the first part of the series. For those who tend toward masochism, each of the first three posts have a link to the next in the series, so feel free to indulge.)

The topic for today's blog post is a tool from statistics called the CPDF (cumulative probability density function). At least that's the name that it was given in the stats class that I flunked out of in college. It is also called CPD (cumulative probability distribution), CDF (cumulative distribution function), and in some circles it's affectionately known as Clyde. In the graphic arts standards committee clique, it has gone by the name of CRF (cumulative relative frequency).

I blogged on the CPDF/CPD/CDF/Clyde/CRF before, and by golly, I just realized that I used two of the names in that blog post. This violates rule number 47 in technical writing, which states that you have to be absolutely consistent in your use of technical terms. This is also rule number 7 in patent writing, where it is generally assumed that different words mean different things. I will try to be consistent in calling this tool the CRF. Please forgive me if I slip up and call it Clyde.

Now that the nomenclature is out of the way, today's blog is an extension of the previous blog post on CRF. Today, I want to discuss the practical aspects. Looking at a CRF, what can we discern about the nature of a collection of color differences? And importantly, what conclusions should we avoid coming to, however tempting they may be.

Brief refresher

Below we have a picture of a CRF. The horizontal axis is color difference. The purplish blue curve represents the percentage of color differences that are smaller than that particular DE.

Picture of Clyde from another blog post of mine

It is rather easy from this plot to determine what are called the rank order statistics. The red arrows show that the median (AKA the 50th percentile) is a shade under 1.5 DE. The green arrows show the 95th percentile as being 3.0 DE.

So, one use of the CRF is to quickly visualize whatever percentile is your favorite. You like the 68th percentile? No problem. Your neighbor's dog prefers the 83rd? Yup, it's there as well.

The plot above is real data from one set of real measurements of real printed sheets. The plot below shows nine different sets of real data. The different data sets show medians of anywhere from 0.3 DE to 4 DE. It's clear from looking at the plots that some are tighter distributions than others. Most people would say that the tighter ones are better than the broader ones, but I try not to be so judgmental. I try to love all CRFs equally.

Picture of Bonnie, from the same blog post, who exhibits multiple personality disorder

So, we see that another use of the CRF is to visualize the overall magnitude of a set of color differences. Of course, the median or 95th percentile also give you that impression, but the CRF plot is visual (great for people who are visual learners), and it incorporates all the percentiles into one picture.

Do we need more than one number?

This begs a question. If I know the median, do I need the 95th percentile as well? Is there any additional information in having both numbers?

I assessed this in that prior blog post that I keep referring back to. Based on the data sets that I had at my disposal, I found that there is a very strong correlation between the median and the 95th percentile (r-squared = 0.903). You could get a pretty good guess at the 95th percentile just by multiplying the median by 1.840. That's actually good news for those who have only a small amount of data to draw conclusions from. The median is a lot more stable than trying to infer the median from (say) 20 points.

But I should add a caveat -- the data that I was analyzing was pretty much all well-behaved. If the data is not well behaved, then the ratio between the two will probably not be close to 1.840. So, having both numbers might provide exactly the information that you are looking for. I mean, why would you be wasting your time looking at color difference data, if not to identify funkiness???!?

The next graph illustrates this point. I started with that same set of 9 CRFs from the previous graph. I scaled each of them horizontally so that they had a median color difference of 2.4 DE. If all the different percentiles have the same basic information, then all the curves would lay right atop one another. 



But they don't all lay atop each other. After doing the rubber band thing to adjust for scaling, they don't all have the same shape. The orange plot is below the others in the lower percentiles, and mostly above the others at higher percentiles. The red plot is kinda the opposite.

What does this observation about the two CRFs tell us about the DE values from which the CRFs were created? And more importantly, what does this tell us about the set of color differences that went into creating the CRF?

(That was a rhetorical question. Please don't answer it. If you answered it, it would steal the thunder from the whole rest of this blog post. And that would make me sad, considering the amount of time that I am going to put into analyzing data and the writing this post! You may actually learn something, cuz I think that no one in the history of the known universe has investigated this topic to the depth that I did to write this post.)

The simple answer to the rhetorical question is that the orange plot is closer to having color difference values that are all the same, and the red plot has more of a range of color difference values. But the answer is actually more nuanced than that. (I recently heard the word nuanced, and I admit that I have been waiting for the opportunity to show it off. It's such a pretentious word!)

Here is the third thing we learn by looking at the CRF: Not all CRFs are created equal. The shape of the CRF tells us something about the color difference data, but we aren't quite sure what it tells us. Yet.

Looking at cases

To help build our intuition, I will look at a few basic cases. I will show the distribution of points in an a*b* plot, and then look at the associated CRF. Conclusions will be drawn and we will find ourselves with a deeper appreciation of the merits and limitations of CRFology as applied to color difference data.

About the data

The data that I use for the different cases is all random data generated deep in the CPU of my computer. I used a random number generator set up to give me DL*, Da* and Db* data that is normally distributed (Gaussian). Note that while DE values are definitely not normally distributed, the variations in the individual components of L*a*b* are more likely to follow a normal distribution, at least when the color process is under "good control". Whatever that means.

A peek inside my computer as it generated data for CRFs

In most of the cases following, I have looked at data that is strictly two-dimensional (only a* and b* values, with the ridiculous assumption that L* has no variation). I will bring three-dimensional variation in on the last two cases. Those two will blow your mind.

All of this work is done with the 1976 DE formula, simply because it is sooooo much easier to work with. The conclusions that we draw from analysis of these cases will not change if we use the DE2000 color difference formula. This is not immediately evident (at least not right now), but trust me that I kinda have a feeling that what I said was true.

I should mention one other thing. The figures below all show scatter plots and CRF plots. I decided to use 200 data points for the scatter plots, since that made a plot where the scatter was pretty clear. If I went larger, the dots all merge into a blob, which is bad. But worse than that is the fact that the size of the blob depends on the number of points in the scatter plot. (I have a solution to that, but it it several blog posts away).

For the CRF plots, 200 points would give a jaggy appearance that would mask the true underlying shape. So, for the CRFs I chose the luxury of enlisting a few more CPU cycles to generate 10,000 data points. My computer didn't seem to mind. At least it didn't say anything.

In all the scatter plots below, I have plotted Da* and Db*, and not a* and b*. The values are relative to some hypothetical target a*b* value.

Case 1

This first case is the most basic. We assume that the distribution of measurements in a*b* is a circular cloud. The values for Da* and Db* are both normally distributed with standard deviation of 1.0 DE, and Da* and Db* are uncorrelated. You can probably see this; I show the scatter plot in the upper left hand corner of the figure, and the associated CRF below.

Case 1, uncorrelated variation of equal size in a* and b*

The lower right corner of the figure introduces a new metric for analysis of the CRF; the median-to-95th percentile ratio. I intend this to be a parameter which describes the shape of the CRF. Dividing by the median makes it independent of the overall spread of the CRF. I have decided to give this ratio a sexy name: MedTo95. Kinda rolls off the fingertips as I type it. 

Note that a lower value of MedTo95 corresponds to a CRF that has an abrupt transition (high slope at the median), and a lower number indicates a more laid back shape.

(The astute reader will note that the number 1.840 that I described in a previous blog as a way to estimate the 95th percentile from the median was a MedTo95 metric based on real DE data. The really astute reader will note that 1.840 is not equal to 2.11. The really, really astute reader will draw an inference from this inequality. The CRF shown in Case 1 is a bit abnormal.)

Case 2

The most natural question to ask is what happens if the cloud of Ddata is moved over a little bit. To put this into context, this is a DE cloud where there is a bias. We have the usual variation in color, but we are also not quite dead-on the target value.

The Figure below shows the Case 1 data in black and this second Ddata in green. I thought it was pretty clever of me to come up with a figure like this that is so incredibly intuitive. If you had to scratch your head for a while before catching on, then I guess I am not as clever as I would like to think.

Case 2, which is the same as Case 1, except shifted over

It should come as no surprise that the CRF has been expanded outward toward larger DE values. We have added a second source of color difference, so we expect larger DE values.

Important note for the analysis of the CRFs: The bias in the color (of production versus target a*b*) caused a reduction in MedTo95.

I should also point out that it makes no difference whether the cloud in a*b* has shifted to the left by 2 DE, to the right by 2 DE, or upward or downward. The DE values will all be the same, so the CRF will be the same.

Case 3

It is hard to compare the shape of the black and green plots of Case 2, since one has been stretched. I have altered the cloud of points in the figure below so that the CRFs have the same median. Note that this scaling of the CRF required a commensurate scaling of the a*b* cloud. So, the green cloud is more compact than the black cloud of points. The standard deviations, shown at the bottom left corner of each of the scatter plots, were cut in half.

Case 3 - two data sets with the same median, but different offset

The MedTo95 ratio was 1.70 in Case 1, and is 1.69 in this case -- almost identical. That's reassuring. I mean, that's why I introduced this shape parameter as a ratio.  

Tentative conclusion #1: MedTo95 kinda works as a parameter identifying the shape.

We see that introducing a bias in our process (the color is varying about a color somewhat different than the target color) changed the shape of the CRF. The CRF of the biased data makes a faster transition, that is, it has a higher slope at the median, that is, MedTo95 is smaller.

Tentative conclusion #2: A lower MedTo95 is an indication of bias - that you're not hitting the target color.

(Please note that I underlined and boldfaced the word tentative. This might be foreshadowing or something.)

Case 4

The next most obvious change we could make to the distribution is to change the relative amount of variation in a* and b*, in other words, to make the scatter plot elliptical. This is to be expected in real data. Imagine that the plot below is of the variation in a* and b* measurements of a solid yellow throughout a press run. The predominant cause of variation is the variation in yellow ink film thickness, which is reflected mostly in the b* direction. 

I will take this a step further. The eccentricity (as opposed to circularity) of the scatter plot is an indication that one cause of variation is predominant over the others. 

The figure below shows the effect that a 5:1 aspect ratio has on the CRF.

Case 4 - elliptical variation

This is cool. The shape of the CRF has changed in the opposite direction. I would call this a mellow, laid-back, sixties kind of cool and groovy CRF, one which makes the transition gradually. The slope at the median is smaller. Graciously, MedTo95 has responded to this by getting much larger. Once again, MedTo95 has given us an indication of the shape of the CRF.

Perhaps we can tie the change in MedTo95 back to the variation in a*b*? 

Tentative conclusion #3: A higher value of MedTo95 is an indication of a departure from circularity of the scatter plot. 

Now we're getting somewhere! We can look at MedTo95 and understand something important about the shape of the scatter plot. If we see MedTo95 go up, it is a sign that we have one source of variation which is rearing its ugly head.

But once again, the word tentative is bold faced and underlined. It's almost like I am warning the reader of some broader conclusion that may eclipse this one.

Case 5

Case 4 looked at eccentricity in the b* axis. This is typical of variation in yellow, but magenta (for example) tends to vary a lot more in a*. What if the angle of the eccentricity changes? 

I played with my random number generator to simulate a variation which has been rotated so that the major axis is in the a* direction. I show the figures below.

Case 5 - a comparison of eccentricity in two different directions

This is reassuring. The CRFs are pretty much identical, and a so are the MedTo95 values. This shouldn't be much of a surprise. A moment's consideration should convince one that the color difference values (in DE76) would be the same, so the CRF shouldn't change. This will not be the case for DE2000 values.

This is good news and perhaps not-so-good news. The good news is that the CRF and MedTo95 of DE76 values is irrespective of the predominant direction of the variation. The bad news is that the CRF and MedTo95 of DE76 values are irrespective of the predominant direction of the variation.

Tentative conclusion #4: CRF and MedTo95 don't know nothing from the direction of variation. 

Case 6

We have looked at a bias and eccentricity of variation in isolation. How about if both occur? In the figure below we look at one possible example of that. The blue cloud has been shifted to the right, and squished horizontally. It was also squished just a bit vertically, just so the median is that same as all the other CRFs. 

Case 6, in which we encounter both sliding over and squishing

From the figure, it is clear that the combination of these two effects causes a CRF that is more uptight than the standard scatter plot that we started with. The new CRF is reluctant to change initially, but changes rapidly once it decides to change.

Thus, we re-iterate tentative conclusion #2: A lower MedTo95 is an indication of bias - that you're not hitting the target color. And, of course, we can forget about tentative conclusion #3: A higher value of MedTo95 is an indication of a departure from circularity of the scatter plot.

How does elliptical distribution with offset (Case 6) compare Case 3, where the scatter plot shows a circular distribution with offset? The two are compared in the figure below.

A comparison of two biased distributions

Here we see two CRFs that are pretty darn close if you look at the area above the median. The MedTo95 of the two are also (to no one's surprise) very close. If I may remind you, the CRFs represent a collection of a whopping 10,000 data points where the initial distributions were algorithmically designed to be normal distributions. You ain't never gonna see no real CRF that is as pristine as these CRFs.

Our tentative conclusions are starting to unravel. :(  

Tentative conclusion #5: There ain't no way, no how, that you can use MedTo95 to diagnose ellipticity when there is a bias.

But, these  conclusions are based on what's going on above the median. There is still some hope that the stuff below the median might pan out. We would need, of course, an additional parameter. Maybe MedTo25? 

Case 7

In Case 6, we looked at elliptical variation that is perpendicular to the bias. The bias was off to the right, and the principle axis of the variation was up and down. Let's look at bias and variation that are both along the a* axis. This is shown in the next figure.

Case 7 - comparison of variation parallel and perpendicular to bias 

The new curve - the one in violet - kinda looks like red curve shown in Case 4. Things have certainly gotten complicated! I will try to capture this in another tentative conclusion.

Tentative conclusion #6: In the presence of both elliptical variation and bias, elliptical variation in the direction of the bias looks similar to elliptical variation. Elliptical variation perpendicular to the direction of the bias looks like bias. 

Ummm... I didn't stop to consider what happens when the elliptical variation is at 45 degrees to the bias. Presumably, it looks a lot like circular variation with no bias. That ain't so good. 

I probably should actually show an example of this. I think the CRF of elliptical variation at 45 degrees to direction of the bias would look a lot like the black CRF that we have been using as a reference, at least above the waist. But, rather than head further down the rabbit hole, I have one more consideration.

Case 8

All of the examples so far have made the assumption that the variation is strictly two-dimensional, that is, in a* and b*. That's a simplification that I made in order to aid in our understanding of the interpreting of a CRF. One would expect that three-dimensional variation is more likely to be encountered in the real world.

In the cyan of the figure below, I modeled spherical variation which is of equal magnitude in L*, a*, and b*.

Case 8 - the effect of dimensionality on the CRF

By comparing the cyan CRF to the black (two-dimensional), we see that adding a third dimension has the effect of making the transition sharper and of decreasing MedTo95. The red CRF has been added to suggest the effect of reducing the dimensionality to something closer to one.

(Some readers may be thinking something along the line of "chi-squared distribution with n degrees of freedom, where n is some number between 1 and 3, where that number might not be an integer." If those words are gobbledy-gook, then that's ok.)

This next figure compares the CRF of a three dimensional spherical distribution with a two dimensional circular distribution with a little bias. 

Comparison of spherical distribution with circular distribution with bias

I think that this might be just a tad scary for those who wish to use the CRF to divine something about the scatter of points in color space. We see two distributions that are nothing like each other, but yet have CRFs that are very similar. 

In a theoretical world, one might be able to tell the difference between these two. But, there are two things fighting against us. First, we never have CRF plots that are as clean as the ones I have created. 

Second, this blog post shows that we have a lot of knobs to play with. The shape of the CRF is effected by the length of all three of the axes of the ellipsoid, as well as by the magnitude and direction of the bias with respect to the axes of the ellipsoid. Without a lot of trying, I have twice come up with pairs of dissimilar distributions where the CRFs are similar. And I haven't even considered variations that are non-normal. Given a bit more time, I think I could get some pairs of CRFs that would boggle the mind. 

The non-tentative conclusion

If two CRFs are different, we can pretty definitively make the statement that there is some difference between the distributions of color differences. But, one might just as well look at tea leaves to divine the nature of the difference in the distributions. Furthermore, if the CRFs of two sets of color difference data are similar, one cannot come to any conclusions about the similarity between the underlying color variation in CIELAB space.

This blog post and the exciting conclusion was not an Aha! experience for me. The Aha! moment occurred earlier, when I was coming to grips with the fact that a bias will mask variation in CIELAB. This was described in one of my blog posts about process control of color difference data

So, what's the answer? How can we look at a cloud of points in CIELAB and draw any inferences about it? The following diagram is a clue -- drawing ellipsoids that "fit" the variation of points in CIELAB. The ellipses are an extension of the standard deviation to three-dimensions. This involves the co-variance matrix of DL*, Da*, and Db* values. It involves a strange concept of taking the square root of a matrix - not to be confused with the square root of the components of a matrix. And it involves principle component analysis. And it is related to Hotelling's T-squared statistic.

The ellipses below were generated using this technique. I will get around to blogging about this eventually!


I gratefully acknowledge the comments are proofreading from a good friend, Bruce Bayne. He won't admit it, but he is a pretty sharp guy.

Thursday, August 24, 2017

Intellectual humor

And now for a little intellectual humor...

For my wordie friends




For my science groupies






Any history buffs out there?






Tuesday, August 15, 2017

Seven incredible duct tape life hacks

I have assembled seven of my favorite life hacks for the guy who always has a roll of duct tape handy.

Hack #1 - Ugly mug

Let's face it. There are many of us who are just too ugly to stomach looking at ourselves in the mirror every morning. Imagine how much better you would feel if you saw Brad Pitt looking back at you? A pic of your favorite actor, a little duct tape, and you can wake up feeling sexy!


Hack #2 - Broken mirror?

Are you in the middle of seven years' bad luck? And can't scrape up the money to replace that mirror? Just duct tape your cell phone to the mirror and put it in selfie mode!


Hack #3 - Read both sides of a newspaper

A drop of oil and you can cut your newspaper reading time in half! Ok, maybe it's not duct tape, but what real man doesn't always have a can of WD40 handy?


Hack #4 - Cell phone mute

You feel a sneeze coming on. You know that your cell phone has a mute button somewhere, but don't have the time to find the manual and look it up. Grab a strip of duct tape, and viola! You got a mute button. (BTW, did you tell your wife that you are at a "convention"? You can also use this on the camera lens when you Facetime with her.)


Hack #5 - Screen dimmer

Those darn cell phones never seem to get that whole auto-brightness figgered out. Duct tape + old man sunglasses = easy reading!


Hack #6 - Can't figger out Word?

Let's face it. Microsoft Word is just too complicated! Two strips of duct tape and a piece of paper and you are word processing with the pros!


Hack #7 - Pill storage

Doncha just hate those cumbersome, ugly, hard-to-open pill boxes? A piece of duct tape and a wall is all you need to organize your pills!



Impressed? Look for my new book in quality hardware stores everywhere.



Tuesday, August 8, 2017

The brightest crayon in the shed

People are always telling me that I am not just the brightest crayon in the shed. But which crayon is?

The yellow crayon screams out "Pick Me! Pick Me!"

Well, white is the logical answer, but yellow is pretty darn close to white in terms of brightness. And a very bright yellow can also be very saturated. In this sense, yellow is kind of an anomaly in the color kingdom. All other colors, when they get saturated (color scientist use the term high chroma), get darker.

Why is yellow such a gosh darn bright color?

Munsell agrees

I am not just making up this "yellow is a bright color" thing. Munsell agrees with me, as we can see from the Munsell color pages below, where I have circled (or ellipsed in some cases) the most saturated colors on each page of constant hue.

A selection of Munsell plates with constant hue

Some preliminary stuff

I will explain why yellow is such a gosh darn bright color, but first, I need to get some fundamentals in place.

The Cohans

Those of you who are fans of my blog (I think there are currently seven of you, worldwide) will no doubt remember a stirring blog post I wrote about the cones in the eye. The image below is a recap of the exciting opening premise of that blog, suggesting that the eye has three types of color sensors, and that they are red, green, and blue.

I looked deep into her eyes,
and suddenly and inexplicably found myself hungry for H
aagen Dazs

The excitement generated at the start of the blog post was short-lived. The whole point of the post was that the colors of the cones in the eye were not quite as black-and-white as the first guess of red, green, and blue. But, if you are taking the final exam for Color Theory 101, then red, green, and blue is the correct answer. Red/green/blue is also suitable for our purposes.

Definition of eight basic colors

The RGB Cohans in the eye (not to be confused with G. M. Cohan, who was red, white, and blue) lead to a simple explanation of the eight basic colors in Color Theory 101. This is all based on a lie, but it is a useful lie. If the red cone is the only cone that sees the light, then the color we will perceive is red. Similarly, if the incoming light stimulates only the green cones, then we see green. And guess what? If it is only the blue cones, then we see blue. I bet you had already guessed that one.



How about combinations? If red and blue cones are activated (but not the green cones) then we see magenta. If the activated cones are the blue and green ones (but not the red), then we see cyan. Finally, if blue is left out and the red and green cones get all the attention, then we see yellow.

I said finally, but really I didn't mean finally, since there are two more combinations. We see black when all the cones are inactive, and white when all three are activated.

The table below summarizes the cone responses to each of the eight basic colors in the RGB color system.

Color
Red cones?
Green cones?
Blue cones?
Black
No
No
No
Red
Yes
No
No
Green
No
Yes
No
Blue
No
No
Yes
Yellow
Yes
Yes
No
Magenta
Yes
No
Yes
Cyan
No
Yes
Yes
White
Yes
Yes
Yes

Oh... I forgot to mention... these eight colors are all the strongest colors. The cells in the table above that have "No" in them mean "zero light", and the ones with "Yes" in them mean full intensity. There are a zillion combinations where the amount of light captured by the three cones is somewhere between full on and full off. These are not the strongest colors.

The importance of the lightness channel

There is a famous experiment -- very famous, everyone has heard of it -- where an ace was flashed on a screen for an instant. If that instant is really small, then the subjects had no trouble identifying the object as the ace of spades. But if they slowed it down so that the ace stayed on the screen for just a little longer, people got all kinda cornfoozled. When the researcher extended the time just a bit more, then the subjects could readily understand that they were being shown a red ace of spades. (For those who did not grow up in a casino, the ace of spades is supposed to be black, not red.)

Here is a YouTube version of the red spade experiment

This dorky (but famous) little experiment sheds a little light on how our eye/brain works, more particularly on how the color signals are encoded in the neurons that connect the eye to the brain. There is one signal (carried on a neuron) which transmits our perception of brightness. 

This is a special signal. It arrives to the brain quicker than the other signals. When the red ace is flashed quickly enough, the signals that further narrow the color down to red don't make it to the brain in time for analysis. A little longer flash, and the red signal makes it, but the signal isn't stable enough for full pattern recognition. A little longer still, and the brain has time to parse the image out and understand the weirdness.

Not only does the brightness signal show up first, but it is far more important than the other signals in terms of our understanding the scene. I am old enough to remember complaining bitterly about being the absolute last family in the whole town to get a color TV. Well, maybe not the last, but my buddy, Gary, had a color TV well before we did. His father worked for Motorola. My father gave me the lame excuse that black and white were colors, so our TV was actually a color TV. It's a wonder that I can function as an adult at all, what with the extreme deprivation and subsequent emotional trauma that I was subjected to!

People leading colorful lives, despite living in a black and white world

The funny thing about B&W television is that it actually worked. I don't recall my father ever setting me down and explaining that light gray could mean the taupe uniforms of Andy and Barney, or it could mean a Caucasian skin tone, or it could mean Ethel's blond hair. Somehow, I just subconsciously understood the color transform, and never questioned it. At least until I enviously watched Gary's TV.

So, why is saturated yellow so bright?

We now have enough background to explain the enigma of bright yellow. One sentence brings it all together: the brightness signal which is fed to the brain from the eye is a combination of the signals from the red and green cones. There are two separate signals that encode 1) the difference between green cones and red cones, and 2) the difference between blue cones and green cones.

All colors that have red and green at the same intensity have the same brightness. A quick look at the table shows that white and yellow are the only colors where red and green are at full intensity.

And that is why yellow is such a bright color.

Tuesday, August 1, 2017

How do you define a color?

I got an interesting question from a good buddy of mine, Mitchell Vaughn, Well, I kinda exaggerate when I say good buddy, cuz I just met him. And it was online, so maybe it doesn't count? But, he said he liked my blog, so I think that's the foundation for a lifelong friendship. Yes. I am that vain.

Here is the question:

I hope you don't mind me asking you a question, which I imagine is a loaded question...but here it is: Are L* a* b* coordinates a color's undeniable "definition"? In other words, is there anything else that needs to be in place to define a color...mathematically speaking? I realize there are several measuring guidelines that need to be met like light source and angle, etc. but wanted to get your thoughts on this. 

Thank you, Mitchell

I have three answers, the first one simple and theoretical, the second one complicated and theoretical, and the third one practical.

Quick answer

Color is properly defined as a sensation inside our head. So, once we have defined the relative amounts of light that the three cones in the eye will see, the color has been defined. Well, almost. The eye, brain, and the glop in between need a reference point to establish what white is. All color understanding in the brain is compared against this white reference. But since you're talking about L*a*b* values, this has already been mixed into the soup.

Sealab stew is a hearty meal all by itself!

So, the first answer is that, yes, an L*a*b* value defines a color, provided you know what white is.

Necessary qualifications

But when we are talking about L*a*b*, we are almost always talking about the color of objects -- be it the ink on a package, the paint on a wall, or the color of a plastic part. And (OK, this is gonna sound weird) objects don't have colors.

Consider the red ace of hearts. What color is the heart? Red, of course.

I took three pictures of two aces below. The camera and cards were not moved, all I did was change the lighting. Honest to god... there was no Photoshopping in the images below. No special tricks, other than playing with the lighting.

What color is the ace of hearts?

In the image at the left, taken with "normal" lighting, we see "normal" colors. The heart on the ace of hearts is red. For the middle image, I turned off all the lights in the room and illuminated the cards only with a 456 nm blue LED. The color of the red ace of hearts is now pretty much the same as the ace of clubs; it's black.

The right-most image shows what happened when I swapped in a 626 nm red LED instead of the blue LED. Now the color of the red ace of hearts is white. Or maybe it's red?  I dunno how you would explain it. True statement: The color of the red heart is nearly the same as the color of the card stock. Subjective statements: If you call the card stock white, then the heart is white. If you call the card stock red, then the heart is also red.

I will pause while you consider the implications of this. The color of the heart depends on whether your brain has decided that the card stock is white or red.

This is an extreme example, but all objects, to a greater or lesser extent, will change color as the spectral characteristics of the light changes. I might add, two colors may match under one illumination, but not under another. The ace of hearts matches the ace of clubs at the blue light club, but matches the card stock in the red light district. My wife loves to say the word for that: metamerism. She is not all that fond of saying red light district, or any of the other words for that.

To define the color of an object, we need to specify the spectral characteristics of the light that hits the sample. 

To make matters worse, the amount and spectral composition of light that reflects from an object depends to a greater or lesser extent on the angle that the light hits, and the angle from which it is viewed.

The images below are of the same blackberry, with the same camera and camera position, but with different lighting. The image on the left has a point source of light, and the image on then left shows the blackberry illuminated by diffuse lighting. The colors of corresponding parts of the two images are not the same.

Which blackberry looks the most succulent?

To define the color of an object, we need to specify the angles of illumination and of viewing. There are an infinite number of combinations, but a small collection of combinations have been standardized so that we can actually communicate about color values. The most common choices are 45/0 geometry (which is equivalent to 0/45) and diffuse geometry.

Am I done yet? No. Our perception of color depends (slightly) on whether it is a small object (projected onto just the inner circle of the retina, called the fovea) or a larger object (which extends to more of the retina). The relative concentrations of cones are different in the fovea than the rest of the retina, so our perception of color changes.

To define the color of an object, we need to specify whether the object is small (the 2 degree observer) or larger (the 10 degree observer). In case you are not confused enough yet, I discuss standard illuminants and observers in a blog post called How many D65s are there in a 2 degree observer?

In summary, the color of an object is a property of the object itsewlf, but also of the spectral composition of the incident light, the angles of incidence and viewing, and the size of the object. Based on that, once you have specified the L*a*b* value and all of these conditions (by saying, for example, 45/0 geometry, D50 illumination, 2 degree observer), you have defined the color sensation, and the color of the object has been defined.

So the second answer is that, for an L*a*b* value to have a precise meaning, you have to specify the instrument geometry, the illuminant, and the observer (2 or 10 degree).

Note that this does not mean the object won't have a different color under different conditions. Sorry for the double negative. Lemme try again. Objects in the mirror may appear closer than they are. Product is measured by weight and not volume some settling may have occurred during shipping. No warranties are express or implied. And, the color of your tie and sport coat may not match under the funky mood lighting when you get back to your apartment.

Practical answer

There is another important definition for anyone in the business of making stuff that has a specified color. Color is defined as that thing that the customer is willing to pay you for, provided you get it correct. It is whatever is defined in the contract. Without a contract detailed enough to have teeth, the correct color is whatever the customer likes.


The astute print buyer will recognize that his Wheaties package might be sitting on a shelf right next to another Wheaties package that was printed in a different press run or even at a different plant. The astute print buyer will recognize that an off-color package (just like an off-color joke) runs the risk of sitting on the shelf until expiration date, at which time it will get thrown out, much to the dismay of everyone who hates to see good Wheaties go bad.

This astute print buyer will also recognize that metamerism could be an issue if different sets of pigments are used to create the ink on the package. In that case, the astute print buyer might see fit to define the color in terms of spectral values, or in terms of color specifications under multiple illuminants.

So, all those previous answers are just academic if you live in the real world and want to get paid for your print job!

The standards folks, I might add, are pushing for a spectral definition of colors. Various tools are being put into place to allow the standardized communication of desired spectra.