Showing posts with label color difference. Show all posts
Showing posts with label color difference. Show all posts

Tuesday, May 19, 2020

Is metamerism a big issue in print? (Part 2)

This is part 2 in a series of blog posts that recap my presentation on metamerism at Color 20. If you were actually looking for the first part, the part where I set up the characters and give the back story, then you should go to the first part.

Ahhh... so you decided to tough this blog post out? Well, good on ya, mate!

Today's post is about the intersection of expanded gamut, spot color replacement, and metamerism. I suspect that this might result in another standing-room-only blog post.

Is metamerism a big deal when you are doing spot color replacement?

Expanded gamut

In kindergarten, I was taught the lie that red, yellow, and blue were the primary colors. I will never forgive my kindergarten teacher for that. That really messed me up when I found out that the real primaries for ink were cyan, magenta, and yellow. There is a big long story about that, but for now, I will just pass the explanation along to Stephen Westland and Stephen Westland and David Briggs and David Briggs. Good articles, all of them.

And then I got even more confused when people kept talking about black ink. Why do you need black ink, if you can get all the color with just CMY? (I mean, I thought the whole idea of primaries is to give you all possible colors?) Well, there are many reasons for using black, but one of them is that you can't get all the colors with just CMY. One notable color that you can't get is black.

And guess what? Even with CMY and K, you can't get all the colors. If you want more colors, you need to add more primaries. Expanded gamut printing uses color beyond CMYK, typically orange, green, and violet, to get more of the entire range of visible colors.

(Interesting fact: Generally we would call this CMYKOGV printing, but that's a really silly order for the letters. Maybe it should be CVMOYGK?)

Spot color replacement

I know that some of you are thinking that spot color replacement is what you do to get your Dalmatian ready for St. Pat's Day. Nope. Good guess though. (To get your Dalmatian ready for St. Pat's Day, I would recommend giving him a long reddish-brown, silky coat.)

My dog Spot is not looking excited about the St. Patty's Day festivities

Historically, there has been a distinction made between process colors and spot colors. Process colors are CMYK and are used in packaging for image content. Each pixel of the printed image gets some build of those four inks. Spot colors are specialty inks that are mixed to the desired color and are printed in, well, certain spots of the printed package. The spot color inks don't usually get overprinted with other inks, and are generally not used in imagery.

This is not an endorsement. They do go well with a wasabi mustard, though.

The package above uses (maybe) a total of eight inks -- cyan, magenta, yellow, and black for the image and spot colors of dark blue, light blue, black, and green. (And there is probably a white to cover the metallic (mylar) surface. White is not referred to as a spot color, but rather a flood coat. I think this is an egregious abuse of the English language.) Each of these inks gets its own print unit.

The next print run will likely require a different set of spot colors. This leads to an expense, since the old spot color inks needs to be cleaned out between print runs. There would be an economic advantage to printing those spot color with an equivalent combination of process color inks. But if we augment those process inks with a few extra colors of inks, typically orange or red, green, and violet or blue, then nearly all spot colors can be emulated with this augmented set of inks. No need to clean up after each print run!

So, there is an economic advantage, but it comes with a hidden cost: metamerism. If one package printed with CMYK+spots should land on the shelf next to one printed with CMYKOGV, then the best we can hope for is a metameric match. Perhaps there is an excellent match under D50, but can you find a store that has good D50 lighting?

That leads us to the question of the day....

Is the degree of metamerism enough to worry about?

Disclaimer #1: I suspect that many of the people who have implemented spot color replacement have gone through the exercise of evaluating the degree of metamerism for the spot colors that are important to them. I don't intend to minimize this or necessarily replace this worthwhile test. My goal here is to help set expectations in general.

Disclaimer #2: If you are bringing a new design into production, metamerism probably isn't an issue for you, beyond perhaps needing to explain to the brand owner why the color of the package didn't match the Pantone book in the designer's living room. If you are switching production of an existing pretzel pouch to spot color replacement, and expect a short period of co-mingling on the store shelves, I leave it to you to decide on the importance of the transition period and weigh the cost of that against savings.

Those who read the previous blog will recall this image of a set of metameric sextuplets, all of which are perfect matches to my version of Pantone 147C under D50/2.

In the delivery room, with D50 lighting, these appeared to be identical sextuplets

The spectra look quite different, but when it comes down to it, is there a large metameric difference?

The following table is stolen from my Color 20 presentation. It shows the CIEDE2000 color difference between Pantone 147C and the emulated version under D65/10. This should give an appreciation for the magnitude of metamerism. The spectra look a lot different, but they still match under one illuminant, and are not a bad match under another.


Not so bad? John shrugs his shoulders. I would be cautious about trying to read much into this table. There are many combinations of CMYKOGV that could yield a given color. The software that I wrote to create the matches did not put a whole lot of thought into which one of those combinations to use. I don't claim that it yielded builds similar to any commercial spot color replacement software, Mileage may vary. This package sold by weight, not volume. Contents may have settled during shipping. Blah blah blah.

Here is another set of metameric sextuplets from my database. In this one, for whatever reason, the spectra are all a reasonably good match. We see some larger disparities around 400 nm, but these are less significant to the eye.


And another set that appear to vary about as much as the first one.


Here are the color differences.


What to make of this table? Once again John shrugs. There are bigger numbers and smaller numbers. The intent here is not to focus on one specific case, but rather to look at the data in aggregate. The database has plenty of aggregate to offer, with 3,604 metameric spectra. Here is the big picture.

I love cumulative probability density functions of color difference data

How to interpret this? John shrugs his shoulders and makes woogly eyes. I have blogged before about this sort of Cumulative Probability Density Function plot, and again here. I show below one very reasonable way to look at this data. The plot can be used to determine the percentage of color differences that are below a certain point.


I arbitrarily set 2.0 ΔE00 as a tolerance. This is a typical tolerance for print under D50/2. From that alone, it seems like a reasonable starting point. But, one may argue that this is a secondary requirement in the eyes of the print buyer. (I want it to match under D50/2, and could you also make sure the match isn't horrible under D65/10?) So maybe this is too wide?

Arguing the other side, there are two contributors that we want to consider. The first is the normal process variation, for which we may set a tolerance of 2.0 ΔE00. The second contributor is the color difference due to metamerism. These two contributors combine in the final analysis. If we allow for 2.0 ΔE00tolerance of normal process variation under D50/2, and we allow for a 2.0 ΔE00 color relative change due to metamerism, then we could see something like 4.0 ΔE00 color change when they happen together.

Now for the math stuff. They two sources of variation could cancel each other out. IT could be that by fluke, the sample is 2.0 ΔE00 off from the target under D50/2, but matches perfectly under D65/10. Generally speaking us folks in the stats world use "sum in quadrature" to describe how tolerances stack up on each other. A 2.0 DE00 variation and a 2.0 ΔE00 variation (statistically speaking) add up to sqrt ((2.0)^2 + (2.0)^2) = about 2.8 ΔE00.

So, is this a big issue for spot color replacement?

Based on this analysis, I can say this: 

If you replace a traditional spot color with another set of pigments,
and you get a perfect match under D50/2,
then you have an 8 in 9 chance of having an acceptable match under D65/10.

I make the assumption here that the normal process variation is less than 2.0 ΔE00, and that a 3.0 ΔE00 variation under D65/10 is considered acceptable. In the next blog post in this series, I will look at other illuminants. 

Tolerance for metameric index

I had a question from Rachel after my previous post regarding reasonable tolerances for the metameric index. I pause to define metameric index in this context. The graph and table I show above fit one definition of metameric index: the color difference that you see between two perfect metamers under one illuminant when you view under a second illuminant.

From my graph, I can say that 2.0 ΔE00 is a reasonable tolerance for metameric index for D65/10. Eight of nine times you can hit that. If you pay a bit of attention to metamerism when you decide on how to render an EG color, you can do better, In the next blog post in this series, I will look at other illuminants. Hint: the change from D50/2 to D65/10 is not huge...

I hope that this leads to some good argument among the folks who like to argue about standards.

Tuesday, July 25, 2017

Is 1.0 delta E a "just noticeable difference"?

My favorite scene from Fiddler on the Roof has a group of men talking politics in the town square. One of the men says that the czar is a really great guy who is bringing prosperity to the little town of Anatevka. To this, Tevya (the main character in the play) replies "Yes... You're right." I wish I could do accents in this typed blog. Imagine a rich, deep, heavily accented Russian-Jewish voice.

Another man disagrees, saying that the czar is destroying tradition in the village. Tevye again nods his head and says "Ahhh... You're right."

Yet another man looks at Tevye and says, "Tevye, how can they both be right??!?" Tevye slowly shakes his head in agreement, "You know, you are also right."


This is the third blog post in this series about the measurement of color difference. To recap, here are the two previous, contradictory explanations about the unit of measure of color difference.

   1. The size of a DE color difference is based on the Munsell Color System, which is all about uniform spacing of colors. 1.0 DE00 is one of 76 perceptually equal steps between pure black and pure white. Color differences throughout color space are scaled to this.

    2. The size of a DE color difference is all about tolerances in the industry. For print work, 2.0 DE00 is considered pretty darn good, and 6.0 DE00 is merely "pleasing".

Naturally, I will tie this up by providing a third contradictory explanation.

What is a JND?

The year 1931 was a banner year for color science. This year saw the publication of a set of tables that directly related to the color response of the human eye. Color could now be measured. Because of this work, you can measure the spectrum of a sample with a spectrophotometer, and then use the tables to convert to a real color.

The four little bumps that all color scientists know and love

I need to explain what I meant by real color. The measurement and subsequent computation would give you a set of three numbers, X, Y, and Z, which are called the tristimulus values. The numbers came with a guarantee: If two color samples measured exactly the same tristimulus values, then they would be perceived as the same color.

But, tristimulus values have two drawbacks. First, the values are non-intuitive. It was not a simple mental task to convert back and forth between tristimulus values and our common concept of color. More importantly, there was not an answer to a very basic and important question in the color industry: How close do two XYZ values need to be in order for them to be a good match?

David MacAdam sought to answer this question in his 1942 paper, entitled "Visual Sensitivities to Color Differences in Daylight". He performed a series of experiments where the test subject adjusted knobs to make one color match another color. Naturally, even if the same test subject repeatedly performs this task, the numbers won't always come out the same. He coined the phrase just noticeable difference to describe this variability.

MacAdams's gizmo for testing color discrimination
not to be confused with gizmos for discrimination against color

MacAdam created what have become known as the MacAdam ellipses, as shown in the image below. The image below is called a chromaticity diagram, and is based on the XYZ values. The ellipses  in the plot represent regions of ambiguity, magnified by a factor of ten. According to his tests, all colors within the various regions are indistinguishable.


These ellipses are ten standard deviation units across. (He chose ten in order to make the ellipses visible.) By my calculation, roughly 39% of all observations would be within ellipses of one standard deviation unit, and about 87% should be within ellipses that are twice the size.

This was a landmark paper. There have been something over 1,100 citations to it. The basic concept in MacAdam's paper was an enormously important realization for everyone who needed to put conformance ranges around color values. If you were to use XYZ as a target value for a color, then you have to allow different acceptance windows for every color and for every direction of color change. Yuck! 

Here is an interesting factoid: the MacAdam ellipses are a counterexample to Stigler's Law of Eponomy. Unlike virtually every other scientific discovery, history has correctly named these ellipses after the person who first described them. Then again, if Stigler's law is infallible, then Science has lost the name of the person who originally proposed the MacAdam ellipses.

A moment of candor with John the Math Guy

I Googled some names, and could not find anyone by the name of Avard Håkansson. Since the name of the original inventor of the MacAdam ellipses is lost, and the name Avard Håkansson is lost, it logically follows that the ellipses should be named the Håkansson ellipses. I am circulating a petition to update the 1,100 or so papers, and the 40K+ websites that refer to the MacAdam ellipses.

MacAdam's paper spurred interest in finding some transform to apply to tristimulus values that would lead to a color space that is uniform. Many attempts have been made at this. I have previously blogged on that subject (boy, that's a surprise), and in my normal obsessive compulsive way, I identified 14 different attempts between 1989 and 2010 alone.

Here's a bigger surprise. I am aware of only a handful of color spaces that were directly based on the MacAdams ellipses. Two were developed by a trio consisting of Friele, MacAdam, and Chickering, and are eponymously called FMC-1 and FMC-2.

The set of equations for FMC-2 are described in the 2002 release of the standard ASTM D2244:02. This document describes the equations in an annex with the title "Color Spaces and Color Difference Metrics No Longer Recommended But Still in Use". The 2004 version of this standard omitted this annex. It is my understanding that the last person who was using FMC-2 retired in 2003.

Here is an interesting factoid: Evidently, just like Fleetwood Mac, Simon and Garfunkel, and the Beetles, there was a falling out between these three gents, and Friele went on to develop the FCM color space by himself in 1978. The new acronym stands for Fine Color Metric. Just imagine the outrage when MacAdam and Chickering found that the acronym did not include their own names!

So, long story short, a just noticeable difference is based on the work of MacAdam on the smallest differences in color that a person is able to discern. To the best of my knowledge, there are no color spaces developed directly on this work that are currently commercially available.

Are they the same? 

I have heard it said that 1.0 DE is 1.0 JND. Is this true?

It is worth noting that CIE 142-2001, which defines DE00, does not include the name "MacAdam" as a reference, or include the phrase "just noticeable difference". So clearly the answer to that rhetorical question is no. Further, a JND and a DE are based on different data sets, so they will differ numerically.

There is a somewhat more philosophical answer, however. One of these measures of color difference is based on perceptibility, and the other on uniformity. Are these ultimately related? I propose a gedanken experiment.

Supposed that I create the gray-to-burnt-orange ramps (described in a previous blog post) in a slightly different way. Instead of basing the ramps of finer and finer subdivision of the range from gray to burnt orange, what if we arranged the spacing of the colors by taking very tiny steps from gray to burnt orange. Each tiny step would be a just noticeable difference.

The development of a JND scale (top) versus
the development of a perceptually linear scale (bottom)

Would the spacing on the two ramps be kinda the same? Another way of asking that question: When my brain makes a judgment call about midway-ness between two colors, does it count JND steps to reach that conclusion?

I don't know. I suspect that there is not a "color midway-ness determination area of the brain". I don't think it is a fundamental concept, and as such, there is a lot of variability in what people might call midway between two colors that are a modest distance apart. I have a set of special brain probes on order through Amazon. When they arrive, I will get right on that question about what's going on in my brain. My wife has been wondering about that for years.

A crinkly wrinkle

I have spent the better part of two blog posts trying to make it clear that the DE color difference and the just noticeable difference do not have the same lineage, so they must be different. Imagine how cruel you will think I am when this whole world comes crashing down. If truth be told, the two are very intimately related.


The formula for DE00 is universally regarded as being the second ugliest set of equations in the known universe. You may reckon differently, but I count a total of 26 free parameters that were available to tweak the equations, including the handful of parameters that were inherited from the formula for L*a*b*. The equations mix Fourier series, Pade formula, square roots, cube roots and seventh powers. There was a lot of knob-twiddling of the free parameters in order to get the equation just right.

Egad. John the Math Guys really don't like this: When regression goes bad. Finding the right model. Mathematical models.

What did the authors use to assess their tweaking? A bunch of large data sets that came from just noticeable difference experiments. While the lineage of DE00 is based on Munsell's perceptually linear color space, there was significant cross-breeding from the JND folks.

Final answer, what is a DE00?

DE00 is a unit of color difference, which has proven itself in practice as a way to assess conformance of manufactured color. It is loosely based on the equal gradations of color in the Munsell space. The magnitude (scaling) of DE00 is based on the size of a color step at the middle of CIELAB space, which was in turn based on 100 levels of gray. The size of a DE00 in other parts of color space was scaled so that the color difference is that same number of just noticeable difference units throughout color space.

Tuesday, July 18, 2017

How big is a deltaE?

Every once in a while, someone in the audience calls on me to ask a question that I know the answer to. That just happened to me, and I am soooo happy!


This is the second blog post in a series about the actual meaning of color differences. I blogged previously about the origin of the DE, in particular, the DE00. I came to the preposterous notion that "the size of a DE color difference is based on the Munsell Color System, which is all about uniform spacing of colors. 1.0 DE00 is one of 76 perceptually equal steps between pure black and pure white."

Today, I want to correct that silly idea. Contrary to what certain bloggers have said previously, the color difference DE00  is a unit of measure which is used for industrial color-difference evaluation. This color difference equation is officially defined in the document Improvement to Industrial Colour Difference Evaluation (CIE 142-2001). The summary of this document starts out with  the sentence "Recommended practice for industrial colour-difference evaluation is presented." (The italics are mine, added strictly to heighten the excitement.)

The question that sparked this series of blog posts

Here is the question that I got from my good buddy, Larry Goldberg. As you will see from his question, he is eloquent, piquant, and just a tad irreverent; three qualities I appreciate in a friend. He works for a little company called Beta Industries, where you can get microscopes and print measurement devices and a variety of other devices for the print industry.

Here is his question:

I'm looking for The Idiot's Guide to delta E, converting scientifically rigorous results to Foolproof Rule o'Thumbs.  Or the more linguistically acceptable Rules of Thumb. Or until the new, improved Fool is released.

Something in simple tabular form such as;

delta E 2000  |  Rule O'Thumb
======================
0                         Deadnuts!
1                         Just Noticeable Difference, depending on who's asking and how much they drank for lunch
2                         Winner Winner Chicken Dinner!
3                         Good commercial color match, Kwitcher belly-achin', looks good to me!
4                         It'll be perfect when you add a little more snap to the magenta.
5                         Whaddya expect on this crappy paper?
6                       TWICE as good as commercial color match, no?  No. The buyer needs another dinner and round of drinks.
7 - 10                Roses are red, violets are blue, the grass is green the sky is blue.  Run it, they'll be wrapping the fish in it tomorrow.
>10                     This is a lot better than when they printed black and white...

If you have a dissertation, or a link, or a suggestion, it would be greatly appreciated.

Boy, have I got a technical paper for you!

The Committee for Graphic Arts Technologies Standards (CGATS) has been feverishly working on a standard that ties numerical color difference to lexical color difference. The title of the standard is "Graphic technology — Printing Tolerance and Conformity Assessment". Those of us in the biz affectionately know it as TR 016. The technical report is free, by the way. Just click on the link in the sentence before the sentence before this one.


This technical report is all about making that critical decision about whether a printed product has conformed to tolerances for color. Yes, this is the stuff of which contracts are made. Come to think of it, citing this document in a contract could simplify an agreement between print buyer and printer. I wonder if the folks on the CGATS committee ever thought about that? I'll hafta mention it during the next meeting I attend.

TR 016 defines four levels of acceptance, with explanations for when these levels are appropriate. Each of the levels has an associated tolerance for color difference (in DE00), and states that 95% of the production samples must have a color difference less than the number. In other words, most of the measurements must be within this tolerance.

Here are the levels:

    Level 1 - "the most color critical applications, e.g., proofing" - 2.0 DE00
    Level 2 - "color critical applications, e.g., commercial printing" - 3.0 DE00
    Level 3 - "utility process color printing" - 4.5 DE00
    Level 4 - "pleasing color" - 6.0 DE00

So, there you have it. The size of a DE color difference is all about tolerances in the industry. For print work, 2.0 DE00 is considered pretty darn good, and 6.0 DE00 is merely "pleasing". Within printing, it is expected that the ink will be kept to a higher tolerance than the print using that ink, and the printing of a proof must also be tighter than the printing of the final product. Kinda makes sense. The variation in the color of the stuff coming out of the print shop can't be any better than the variation of what goes in.

Other industries may have tighter or looser tolerances for color. Please add to the comments below if you know about color tolerances in other industries!

Pondering

Consider this: The tolerances for color are based on a scheme for equal steps of color, which is where the DE came from. Somehow it seems a bit odd to put those two together. But one big benefit of this scheme is that it is based on our perception of color. That's a good thing, since our perception is certainly not linear with reflectance. Another big benefit is that our perception of the size of a DE00 is largely independent of the color that you are looking at. That is, we don't need different tolerances for different colors or directions of color change.

On the other hand, I would argue that our acceptance of a difference in color between two samples is not necessarily the same as our perception of the gradations of color, especially when those two samples are not side-by-side. We are much more discriminating when we see two bags of potato chips sitting next to each other on the shelf.

A color that is slightly off will sit on the shelf until expiration date

And when the colors are not side-by-side? I would argue (without much data to support this) that our brain is much more forgiving of color changes that are strictly changes in lightness or chroma than they our of changes in hue. I would also argue (again without a grain of evidence) that we tolerate differences much better if the whole image has that same sort of shift. And once again without anything to support this, I claim that the brain is much more forgiving of colors in busy images with lots of fine detail.

Comparison of a health food drink ad in a glossy magazine and on newsprint
(Images courtesy of JMG Design Services)

There is a committee in the CIE (TC8-16) that is currently working on trying to quantify Consistent Colour Appearance -- what is it that makes our brain accept the two images above as being "kinda the same", versus if those two images were shifted in hue? There are some bright and knowledgeable minds working on this committee. And then there is one dim-witted slacker who just sits around and writes self-important blog posts all day.

But on the third hand, industrial tolerances with DE00 are amenable to measurement with existing technology. What good is a unit of measure if you can't find a ruler?


That's all for part 2 of this trilogy of blog posts. Stay tuned for part 3, where I revisit the phrase just noticeable difference, and admit that the first two parts of this series were nothing but lies!

Wednesday, November 9, 2016

Statistical process control of color difference data, part 4


Warning: If you were considering whether to jump off the diving board into this blog post because this series is getting too deep mathematically, then I would suggest for you to get off at this stop and wait the next bus. On the other hand, if you were one of the hardcore color geeks who has been chafing at the bit for me to get to the meat of the matter, then read on, read on. If you get all the way to the end of this blog post and find yourself saying "yeah... that all makes sense", or even "John is completely wrong on this!" then I commend you. I hope to get a chance to have a beer with you.



There have been a number of comments on the previous blog posts (primer on SPC, deltaE is not normally distributed, and anomalies with standard deviation) from hardcore color geeks. All of these comments are from smart color scientists. Please note that smart color scientists either have beards, or are named Dave. Unless, of course, they are female, in which case they like Thai food.

David MacAdam, Albert Munsell, and Deane Judd
All sporting beards!

Dave Wyble suggested looking at the variance on the individual components, ΔL*, Δa*, and Δb*. "Conventional wisdom says [component differences] will be normally distributed..." Come on, Dave. When was wisdom considered "conventional?" 

(Color scientist of the world today trivia fact number seventeen: Dave does not have a beard at this time. He has, however, had one at various times in his life.)

Max Derhak anticipated this blog post in one of his comments: "Isn't this a Chi-squared distribution?" 

Steve Viggiano commented: "Having advocated Hotelling's t-squared for this application for decades, I am interested in where this is going." He also commented on the distinction between deltaE and deltaE squared, and the unrealistic assumptions baked into the chi-squared distribution. I will address these directly.

These folks are all hardcore color geeks. Max and Steve both have beards, by the way. Come to think of it, I also have a beard. Therefor I must be a smart color scientist... a smart color scientist who is not so good with syllogisms.

The question on the chalkboard today is this:

Do color difference values, as measured by the square of the ΔEab values, have a chi-squared distribution? If not, then what is it?

Literature review 

Several sources have suggested that ΔE has a chi-squared distribution. The earliest I have found is from Fred Dolezelak [1]. He looked at measurements from 19 print runs and came to the following conclusion:

"[The ΔE values] followed a chi-squared statistic, characterisable by a single parameter, which could be linked to the standard deviations in L*, a*, and b* space."

In the Appendix of his paper, he referred to a previous paper, by H. G. Volz, which demonstrated this. I took a cursory look for the paper, and didn't find it. I admit to not trying real hard. It's in German. Unlike most color scientists, I don't read German.

Dolezalek's paper included the following graph, supporting his claim. Note that this is technically known as a funky-graph because of the nonlinear scaling on the y axis. This crazy scaling is designed so that data from a chi-squared distribution will plot out as a straight line.
One set of data, from Dolezalek's paper

All in all, this is not a bad fit to the data. But note that it can be seen to fall off at the right end. The four points at the end (the four points with highest ΔE) are all below the line. This is a sign that perhaps the curve fit is not ideal.  The fact that the curve fit starts falling off at the 80th percentile is bad juju for SPC. For SPC, the upper control limit is conventionally set to the 99.75 percentile. 

I will amend Dolezalek's statement accordingly: "[The ΔE values] followed a chi-squared statistic, but not in the area where SPC needs!"

The next reference I found is from an unpublished document by a highly respected friend of mine, Dave McDowell [2].  Kodak produced a test target which may be familiar to my readers - around 700,000 of these were manufactured. Kodak wanted these to be produced to tight tolerances, so they were very rigorous about their process control. They found the chi-squared statistic suitable for their needs.

Kodak QC60 target

Here is what Dave said:

"The quantity 'deltaE/2 - avg' when squared follows the chi-squared distribution...

"Evaluation of a large number of samples of the Kodak Q60 transmission and reflection targets showed that the deltaE characteristics of individual samples compared to the batch mean followed this same statistic." 

Before I go on, I want to highlight the "when squared" part that Dolezalek had inadvertently missed. The metric that theoretically has chi-squared distribution is not ΔE, but rather ΔE squared. I am sure that Dolezalek was aware of the fact, since his results were at least reasonable. It was probably an unintentional omission on his part. Steve Viggiano reiterated this in a comment to part 2 of this series.

Unfortunately, McDowell did not provide any data or plots by which we can assess the strength of his statement. He has provided me with the data, however. Winter is coming in Wisconsin. Plenty of time for me to curl up with my laptop and savor the 150 files. (It goes without saying that Dave does not have a beard.)

(The text that was quoted above later appeared in a white paper from Kodak [3]. This makes sense, since McDowell worked for Kodak at the time.)

Steve Viggiano is another highly respected friend of mine who has weighed in on this topic, again in an unpublished document [4]. Viggiano was the first (to my knowledge) to articulate the precise conditions that must be met in order for the chi-squared function to be applicable for ΔE. I don't mean to say that Viggiano invented these criteria - they go with whoever invented the chi-squared function. I mean to say that Viggiano was the first to assert these criteria for the distribution of color difference values. Following Stigler's law of eponymy, I will refer to these as Viggiano's criteria.

More on these criteria in the next section. A lot more. I might add that this blog post would not have been possible without Steve's prolific pursuit of pedantic pleasures. He knows this stuff better than I ever will.

Moving along to additional chi-squared sightings, the ASTM standard E 2214-02 [6] has a brief mention of the distribution. It states the following: "As observed in Fig. 2, the mode, median, and mean of a set of color difference (ΔE) determinations do not follow a bell curve but a curve related to the Chi-squared or F statistical distributions..." There is unfortunately no further explanation.What is the relationship? When is F applicable?

I know of one additional reference that discusses the statistical distribution of ΔE values, a paper by Maria Nadal et al. [5]. In their paper, they compared various methods for determining the 95th percentile of color difference data. 

Why the 95th percentile? Two of the authors of this paper are from NIST. For a fee, NIST makes official color measurements, usually of colorimetrically stable objects such as Lucideon tiles (previously known as Ceram tiles. which were enshrined in the literature under the name BCRA tiles). As part of their service, they assign confidence intervals to the measurements. They are required to report the 95% confidence interval.

This is very useful analysis and a well thought out paper, since there is a dearth of technical information on real-world evaluation of the distribution of color difference data. But, the analysis in Nadal et al. is not necessarily directly applicable for our goal, however. For SPC, one needs the 99th, or preferably, the 99.75th percentile. Our problem is more difficult, since we are interested in the shape of the distribution way out in the tail.

Putting our quest in perspective

What is the chi-squared distribution?

Let's say that you take a bunch of random data - values sampled from a distribution - and then add them in quadrature. (This is a fancy phrase meaning that you combine them with the Pythagorean theorem, which is to say, you square each one, add up the squares, and then take the square root of the sum.) The result is a chi-squared distribution, provided the Viggiano criteria have been met. (Yes, I will get to those criteria. Don't rush me!)

The chi-squared distribution is not just a single distribution; it is a family of distributions. The members of the family are distinguished by the number of random variables that were added together to get that distribution. We refer to any of the family as a chi-squared distribution with n degrees of freedom, where n is the number of random variables that were summed in quadrature.

Once the number of degrees of freedom has been decided upon, there is only one parameter left. This parameter accounts for a scaling of the distribution along the ΔE axis, and is dependent on the standard deviation of the distribution from which the random variables have been taken.

Note that the ΔEab formula is equal to the sum in quadrature of the differences in each of the colorimetric components: ΔL*, Δa*, and Δb*. So, it is at least a potential candidate for the chi-squared function with 3 degrees of freedom.

For the distribution of ΔEab squared to be chi-squared, the distributions of the three components must satisfy all four of the following criteria (as recited by Viggiano):

    1. They must all have zero mean. 

    2. They must all be normally distributed.

    3. They must all have the same standard deviation. (ΔL* can't dominate, for example.)

    4. They must be independent. 

Important plot point: If we can ascertain that ΔE squared follows the chi-squared distribution then finding the 99.75 percentile would be a simple matter of arithmetic applied to the mean.

Does the TR 002 data fit the chi-squared distribution?

I tested the TR 002 data to see if the chi-squared distribution thing worked. The data is measurements of 928 different CMYK patches as printed on 102 newspaper presses throughout the USA. (The data set is further explained in a previous post in this series.)

I first computed the average L*a*b* values for each of the 928 patches. Each of these averages was thus representative of what would be printed on the 102 different newspaper presses. For each of the 928 patches, I then computed the color difference, in ΔEab, between this average and each of the 102 measurements. This gave me a collection of 102 X 928 color difference values. More than enough to wallpaper my kitchen.

A comment here: My dog asked me why I didn't use ΔE 2000, rather than ΔEab. He felt that it would be more useful to use the latest and greatest color difference formula. Presumably this is the formula that will get the most air time in the future. I agreed with him (he is pretty smart, as dogs go), but explained that, for purposes of the initial investigation in this blog post, I prefer to use ΔEab. If all of the Viggiano criteria hold true, then the square of ΔEab would precisely fit the chi-squared distribution with three degrees of freedom. If this part holds true, then the next step would be to see if ΔE 2000 was reasonably close. (A bit of foreshadowing: My conclusion, as we shall see, is that even ΔEab did not fit this model.)

I generated cumulative probability density functions (CPDFs) for each of the 928 patches. I scaled each of the CPDFs by their mean. In this way, they all had a mean of 1.0 ΔEab. Bear in mind that if the variations truly follow a chi-squared distribution, then all of these would have the same shape, but just different scaling in the x axis. So assuming that all four criteria are met, these color difference values should all be from the same distribution. Therefor I can combine them into one CPDF. This gives me the advantage of having 928 X 102  = 94,656 data points, so the resulting CPDF will be relatively smooth.

To check the assumption of chi-squaredness,, I used a Monte Carlo method to generate the CPDF of the hypothetical distribution if all the Viggiano criteria hold. I generated 94,656 sets of hypothetical variations (in ΔL*, Δa*, and Δb*), each of which drawn from a normal distribution with mean of 0 and standard deviation of 1.0. I then went through the ΔEab formula to generate hypothetical color differences. Finally, this collection of values was normalized to have a mean of 1.0 so as to best match the distribution computed from the real TR 002 data.

Generating a plot of a CPDF from a collection of values is a rather easy task, by the way. (Thank you for asking how it is done.) First, the data is sorted from smallest to largest. Next, a second array of the same length is generated with values incrementing in fractional steps from 0 to 1. This incremental array is then plotted as a function of the color difference array. Note that this is kinda the reverse of the way we would normally plot.

The plot below shows a comparison of the two CPDFs. The blue line is the actual data, and the red line is the chi-squared distribution with three degrees of freedom. Both have a mean of 1.0. Gosh. They look different.

Do real color difference values follow a chi-squared distribution?

The above plots can be differentiated to create a probability density function, as shown below. As expected, they are not as smooth as the CPDF curves, but it is still clear that the two distributions are dissimilar. Real color difference data us more skewed to the left and has a longer tail to the right than the distribution based on the chi-squared function with three degrees of freedom. I put that in italics, since it kinda sounded like an important conclusion.



Clearly the distribution of real color difference values does not follow a chi-squared function with three degrees of freedom. What went wrong? One or more of the Viggiano criteria must have been missed. Let's look at the criteria one at a time.

Zero mean

Do the differences ΔL*, Δa*, and Δb* all have zero mean?  In general, this depends on how a given data set is compiled. I see three general cases:

In the first case, the data itself is used to define the target color. In a Mean Color Difference from Mean (MCDM) scenario, the target L* value is the average of the L* values of the data set, and similarly for a* and b*. In this case, the ΔL*, Δa*, and Δb* have zero mean by design. This is the official formula for determining the repeatability of a spectrophotometer. This was also the case in the analysis of the TR 002 data set that was presented in the second post of this series, and in the previous section. 

A second case is described in Nadal, et al. They talk about looking at all pairwise color differences in the data set. For example, in a set with ten color values, the color difference would be determined between the first sample and each of the nine other samples, between the second sample and each of the eight others, and so on. For ten color values, there are thus 45 different unique combinations.

It is not immediately obvious, but this case also has zero mean for ΔL*, Δa*, and Δb*. Consider the case where all pairings are considered, not just unique pairings. That is to say, one computes ΔE (sample n, sample m) as well ΔE (sample m, sample n). Noting that ΔL* (sample n, sample m) = - ΔL (sample m, sample n), it is easily seen that for every pairing, there is the reverse pairing which balances it out. Thus, if one considers all non-unique pairings, the three colorimetric components all have zero mean.

Since ΔEab is one of the commutative color difference formulas, the color difference for a pairing is the same as that of the reverse pairing. Therefor, the distribution of ΔEab is the same for the case of all pairings and all non-unique pairings. I would argue then that the first criterion is met with the case presented by Nadal, et al.

Both of these are (somewhat) unnatural cases, which is to say, not generally encountered in the SPC of color. Generally speaking, the target color has been externally specified, typically by the customer of the product. Although the process has been adjusted to come close to this color on average, this will never be exactly the case. It is not atypical for the average color of a print run to be a few ΔEab from the target color. Therefor, at least in the SPC of color in printing, Viggiano's first criteria is rarely met. Remember that the whole gist of this series is SPC? 

With SPC, we would therefor expect that the violation of the "non-zero mean" criteria will have a major effect on the distribution of color difference values. Viggiano anticipated that I would write that in my blog one day, so he mentioned that if the zero mean criteria is violated, then color difference will follow a non-central chi-squared distribution. 

Thus, when SPC is performed on color difference data, the non-central chi-squared distribution is the appropriate choice (assuming any of the chi-squared distributions are appropriate). Once again, I used italics cuz this sounded important.

Normal distribution of components

Are the distribution of ΔL*, Δa*, and Δb* normal? Gosh. This is not a simple question. On the one hand, it seems like a reasonable assumption, At least as a starting point. 

On the other hand, the values L*, a*, and b* are computed through a nonlinear transform of X, Y, and Z, so strictly speaking, either XYZ or L*a*b* could be normal, but never both. But then again, the nonlinearity is small when compared to the typical variation, so the effect is  probably not of practical importance. (This statement relies on a simple rule - every smooth function looks like a line of you look at a small enough piece of it.)

But, on the third hand, there are certainly conditions where the variation of L*a*b* is distinctly not normal. For example, if the process has a pronounced drift, the variation could resemble a uniform distribution. If the process has a sinusoidal fluctuation then the distribution will be a U shaped distribution with asymptotes corresponding to the two extremes of travel. I once figgered out what the formula for that distribution is. I fergit just now what my answer was.

I will argue that, with good SPC, care is taken so that the process is in known, good working condition.before initial characterization. This, of course is not always the case. The idealist side of my brain would put my foot down and say "WHAT!!?!?!? Gosh darn it to heck! If the process has an oscillation or drift, then in the name of peanut butter and jelly sandwiches you better fix it before you do any characterizing!!" But the realist side of my brain is willing to admit the possibility that some (if not all) processes have drift and/or oscillation that cannot be eliminated.

I generally avoid having the idealist and the realist sides of my brain in the same room together. It avoids a lot of arguments. But in this particular case, the tiny tiny portion of my brain that has some modicum of mediation skills was able to come to a compromise that was suitable for both of the other sides of my brain. If the process is capable (in the SPC sense of the word) of providing product that is within the customer tolerance, then does it matter if there is oscillation or drift? If it costs money in the long run to get rid of that anomaly, then one has to weight this against another customer requirement - price.

Getting back to the matter at hand, I am going to start with the bold assertion that when the process is in good working condition, the variation will likely be close to normal. But I will follow up with a little investigation to back this up.

I tested the TR 002 data to see if the variations in the colorimetric components had a normal distribution. My testing amounted to analysis of skewness and kurtosis.

-- Skewness

The skewness was computed for each of the 928 patches and each of the 3 colorimetric components. This gave 2,784 values for skew. Each value of skew represented the distribution of a different set of 102 samples.

The graph below shows all the values of skew.

Skew of ΔEab values

What to make of this? There are various rules of thumb about how much skew is of practical importance. Perhaps a skewness with absolute value greater than 1 or 2 is considered to be significant? By that rule of thumb, skew is not a problem.

A more precise test comes from a table in my favorite statistics book [7]. According to the table, if I were pulling 100 samples from a perfectly normal distribution, I would expect that 2% of the time, I would have a skewness above 0.567 or below -0.567. In this data set, I saw that 16.6% of the skewness values were above this number.

So, I can say with statistical certainty that an inordinately large number of the data sets are skewed. Oddly, about two thirds of these are skewed positive and one third is skewed negative. I don't know why that is! Why would the variation of some colorimetric components of some of the patches go positive and others negative? Without careful examination of the data, I would guess that there are some outliers? I might even go so far as to guess (rather oxymoronically) that there are an appreciable number of outliers. Someday when I run out of beer in the fridge, and run out of reruns of Get Smart to watch, I will look at that.

Then the realist side of my brain kicks in. "Really? Did you happen to notice that there are only seven cases where the skew is greater than 1.5??!? What are you smokin'? That's not a lot of skew!!!"

--Kurtosis

Kurtosis is the other popular measure of a data set that can be compared to that of the normal distribution to test for normality.

I compared the kurtosis values against the 1% ranges for kurtosis (also from [7]) , and found a similar situation. 6% of the data sets showed a statistically significant deviation from the normal distribution, with some being leptokurtic and some be platykurtic. (Man! I love those words!!)

Without a whole lot of guidance, I am going to jump to the wild conclusion that the kurtosis is not of practical significance.

--Conclusion of normality analysis

So, my conclusion is that there is a statistically significant number of color difference measurements that have skew and/or kurtosis. Some go one way, and some the other. But from a practical standpoint, the skew and kurtosis are not appreciable. It is unlikely that this Viggiano criteria that has been violated.

Equal standard deviation and independent

In the beginning of this blog post, I stated that I would take the Viggiano criteria one at a time. A lot has happened since then, and I have changed my mind. I have lumped these two criteria together, since they are symptoms of the same illness. If the illness is present, it will manifest in one or the other of the criteria, or perhaps both. I believe this analysis is unique to the color science world, but perhaps not among chi-squared-ologists.

To help understand this, consider the two plots below. For the plot on the left, I generated pairs of x and y values from a random number generator that gave mean of 3.0. For the x values, the standard deviation was 0.1, and for the y values, the standard deviation was 0.7. The plot on the right is that same data, but rotated about {3, 3} by 45 degrees.  


The data set on the left violates Viggiano criteria #3, since the ratio of the standard deviation in y is 7 times that of x. On the other hand, there is no correlation between the two axes. In other words, it passes criteria #4, but fails criteria #3.

In the data set on the right, the standard deviations of the x and of the y values are practically the same, so criteria #3 has passed. On the other hand, the correlation coefficient between the x and y values is 0.958. With such a strong correlation, the data on the right clearly fails at criteria #4.

From the standpoint of the problem at hand, the two data sets are identical, so the conclusions should be identical. In the one case a reasonable test is to look at the ratios of the standard deviations. In the other case, the correlation coefficient seems like a likely test. This begs the question about how to equivalently evaluate the two criteria, and how to catch the situation where the "illness" has been apportioned to both of the criteria. 

-- Interlude into ellipsoidification

I have developed a technique that is appropriate here. I mentioned the technique in a blog post about the color red back in January of 2013. I dubbed it ellipsoidification.  I have not seen this described elsewhere. Certainly the word is novel, if not the technique.

Ellipsoidification is an extension of the standard deviation to multiple dimensions. 

[Note to those who have committed ASTM 2214-02 [6] to memory. Section 6.1.1 describes an extension to standard deviation to multiple dimensions. While the method 2214 is similar - perhaps even very similar - it just misses a truly beautiful result.]

Ellipsoidification produces a vector with one standard deviation value for each dimension of the data. In the case of uncorrelated coordinates (as in the example above on the left), the multi-dimensional standard deviations are equivalent to the standard deviations of each of the individual dimensions (i.e. stdev (x), stdev (y), etc.). 

For data that is correlated in one or more dimensions, the results are the same as if you first rotated the coordinate system so as to make all the axes independent, and then took the one dimensional standard deviations of each component individually. In the example above, the plot on the right would first be rotated by 45 degrees, and the the standard deviation would be computed on each of the axes. Thus, the two plots would have identical multi-dimensional standard deviations, as we would hope.

That was one explanation of the technique.

Here is another explanation of the multi-dimensional standard deviation. Say we have a set of one-dimensional data. It is a set of points scattered along a line. The standard deviation is a line whose length is somehow representative of the amount of spread of the data points. In two dimensions, we do that same trick, but in this case, we are finding the ellipse which best describes the spread of data in two dimensions. In a sense, we "fit" an ellipse to the data. 

In the case of the example above at the left, the ellipse has the major axis straight up and down and the minor axis is right to left. The major axis has length of 0.1 and the major axis has length of 0.7. In the example at the right, the ellipse has the same major and minor axes, but it has been tilted by 45 degrees.

Below I have an actual an example of an ellipsoidification caught smiling for the camera. This is a two dimensional one, since my three dimensional display is at the cleaners getting its nails done. All those little black points that look like data points are data points, generated by a random number generator with normal distribution.

The red ellipses are the one, two, and three sigma ellipses generated from that random data set. I should point out that, although we are dealing with a normal distribution, the one, two, and three sigma probabilities that we memorized for the third grade stats class (68%, 95.4%, 99.75%) no longer apply. In the case below, we are looking at a two-dimensional normal distribution. 

I think this is a pretty cool plot

If we take that to three dimensions, as for L*a*b* data, we are fitting an ellipsoid to the scattering of the data points, Hence the term "ellipsoidification". The multi-dimensional standard deviations are the lengths of the three axes of the ellipsoid. Note that a by-product of ellipsoidification is the orientation of the ellipses, which could be useful. Note that I used this to properly tilt the ellipses above. On production data, the orientation of the ellipsoid can help point to the major cause of the variation.

That was the second explanation.

The first explanation was for the logophiles, that is, mainly in terms of words. The second explanation was for the pictophiles, that is, mainly in terms of a visualization in one awesome graph. The third explanation is for the folks who might actually have to do something with this mess. It is the most useful, because it is algorithmic. It is also, perhaps, the most difficult to understand. At least for me. I dunno, Viggiano probably stared at that plot above for a few seconds and figgered out the algorithm. 

(Color scientist of the world today trivia fact number twelve: Steve Viggiano and John the Math Guy went to different high schools together.)

Here's the third explanation, very terse and incredibly dense: Ellipsoidification is by a complex method involving rotation of coordinate systems to achieve uncorrelated data. 

I think this is a novel finding. 

-- Now back to our data analysis, which is already in progress...

I applied ellipsoidification to the data in the TR 002 data set. For each of the 928 patches I got three values -- the lengths of the three axes, or in different words, the standard deviations in each of three directions.

The real question for us (remember back to criteria 3 and 4?) is not the magnitude of the axes of the ellipsoid, but rather the relative magnitudes of the three axes. If they are all close to the same size, then the appropriate number of degrees of freedom for the chi-squared function is three. If two are the same size and one of them is zero, the there are two degrees of freedom. But how big a difference in magnitude could be considered large enough to lose a degree of freedom?

As an example, let's say that largest axis of the ellipsoid has a length of 1, and another axis has a magnitude of 0.333. By using the Pythagorean theorem on this example, the effect of that second dimension is only a 5% increase in ΔEab. Let's make a rule that this is considered negligible. By this somewhat arbitrary rule, if the shortest axis is less than a third of  the length of the longest, then a three dimensional variation is effectively a two dimensional variation. If two of the axes are less than a third of the length of the longest, then the variation is effectively one dimensional, that is, along a line.

This gives us a method by which to quantify the dimensionality of the variation in the TR 002 data set. I determined by this rule that 

     46.6% of the patches have three dimensional variation,
     40.2% of the patches have two dimensional variation, and 
       6.4% of the patches have one dimensional variation.

Wow. I think this makes sense. I would guess that the variation in the color of a patch is largely due variation in the amount of ink transferred to the substrate, or variation in the dot gain of the ink. If a patch has predominantly only one ink, then I would expect that the variation is largely in the direction of the trajectory of that ink, that is to say, the variation is largely one dimensional. Similarly, two inks would have two dimensional variation, and three or more would have three dimensional variation. It would be an interesting research project to look at individual patches and see if the dimensionality of the variation correlates with the number of inks present, but, that's a different question. 

Today we are pondering what the statistical distribution of color difference values looks like. From this analysis, it would appear that the variation from the TR 002 data set should be chi-squared with something less than 3 degrees of freedom. The exact number of degrees of freedom depends on the number of inks, and their relative proportion. Note that, while the chi-squared distribution makes intuitive sense only when the degrees of freedom parameter is an integer, it is still defined for non-integer values. Thus, a C40, M40, Y10 patch may exhibit 2.3 degrees of freedom. 

This is a similar conclusion to that of Nadal et al. They conjectured that the deviation from chi-squared distribution with three degrees of freedom was due to a violation of criteria #4. They used this to justify the use of the number of degrees of freedom as a regression parameter. They report determining a value of 2.4 for the degrees of freedom in one of their data sets. They did not consider the possibility of a violation of criteria #3, but I showed that this would have led them to the same course of action.

So, failures of criteria #3 and/or #4 can be seen in the data. This means that a chi-squared distribution of degree less than or equal to 3 is appropriate.

Conclusion

There are a number of significant findings in this. 

1. I have demonstrated that, at least for one data set, the distribution of the square of color difference (ΔEab) values does not follow a chi-square distribution with three degrees of freedom. I have tracked the cause of the failure down to the fact that the variation in L*a*b* is somewhat less than three dimensional. 

2. I have conjectured that the dimensionality of the variation (in printing) is connected to the number of inks that are present in the overprint. The data is there, I have not done the analysis to verify this. Ideally such an analysis would allow one to use the halftone percentages of a given color to predict the value for the degrees of freedom in the chi-square distribution. Alternatively, it could be determined from the data when characterizing the process.

3. For SPC, it is normally the case that the target color is dictated from above. This means that ΔL*, Δa*, and Δb* will usually not have zero mean.

4. I have proposed that for SPC, color variation can be modeled with ΔL*, Δa*, and Δb* being normally distributed.

5. If you combine points 2, 3, and 4, you have the distribution of ΔEab. It is a non-central chi-squared distribution with three or fewer degrees of freedom.

6. I have described a multi-dimensional extension of the standard deviation, which I call ellipsoidification. This can be used to determine the shape of the cloud of variance in any dimensional space. While the immediate application to color is apparent, the method could apply equally well to 30-some dimensional spectra or to the analysis of the variation in the price of a collection of ten stocks.

7. This analysis was carried out with the ΔEab color difference formula. I am going to conjecture that all this will work with ΔE 2000, or any other color difference formula that you choose. After all, the other color color difference formulas are all about ellipses. What could go wrong? Well, except for that pesky ΔE 2000 formula.

This is a work in progress. <Cue Man of La Mancha.> In my vision of SPC for ΔE, the appropriate distribution will be used - perhaps the non-central chi-squared distribution with something less than 3 degrees of freedom. (To dream, the impossible dream...) The amount of non-centrality and number of degrees of freedom will be discerned from the characterization of a process to arrive at the 99.75th percentile ΔE 2000. (To fight the unbeatable foe...) During production, this will be used as the upper control limit, but also - once enough production data has been received - the same techniques will be used to provide additional diagnostics. (This is my quest, to follow that star...)

But I have a lot of work to do before all these pieces fall into place. (No matter how hopeless, how near or how far...)

To Dream the Impossible Dream!

I am I, John the Math Guy,
the guy with the slide rule...

Ok... maybe I got a little melodramatic there. Sorry.

Addendum

I continue in my search of SPCDE.

Bilbiography

[1] Dolezalek, Friedrich, Appraisal of production run fluctuations from color measurements in the image, TAGA 1994

[2] McDowell, David, Statistical distribution of DeltaE, pdf dated Feb 20, 1997

[3] Anonymous, Kodak Q-60 color input targets, Kodak tech paper, June 2003

[4] Viggiano, J A Stephen, Statistical distribution of CIELAB color difference, June 1999

[5] Nadal, Maria, C. Cameron Miller, and Hugh Fairman, Statistical methods for analyzing color difference distributions

[6] ASTM E2214-02, Standard practice for specifying and verifying the performance of color-measuring instruments

[7] Snedecor, George, and William Cochran, Statistical Methods, 7th Ed., Iowa State Press, 1980, p. 492