Showing posts with label metamerism. Show all posts
Showing posts with label metamerism. Show all posts

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.

Wednesday, July 30, 2014

That's a yellow of a different color!

I checked out the yellow pages to find a yellow cab to take me down the yellow brick road to the yellow submarine so I could get a can of mellow yellow. So many yellows!  Are they all the same?

I have used the word metamerism in three previous blogposts: RGB into Lab, Scribbling away that scratch on my car, and Is your green the same as my green. But, I really haven't explained why there is this thing called metamerism. Why is it that a pair of colors may match under one light, but not under another?

Example 1

In the image below, I show the spectrum of one particular yellow printing ink. The image also shows the spectral response of the three cones in the human eye, with the L (long), M (medium), and S (short) wavelength cone responses in red, green, and blue, respectively.

The spectrum of yellow ink, along with the sensors in the eye

If I can be so presumptuous as to paraphrase what the yellow graph is saying, we see that above about 530 nm (in the green to red parts of the rainbow), the yellow ink has a pretty high reflectance, somewhere up around 90%. Below 470 nm (in the violet to blue part of the rainbow), the reflectance is pretty darn small.

To continue my presumption, consider what an S cone (the blue plot) is seeing when it is pointed at this ink. It sees light in the wavelength range from 400 nm to 500 nm. This channel is pretty quiet. There isn't just a whole lot of light reflecting from this region of the spectrum.

This darkness is all completely unbeknownst to the L and M cones. In their little view of the electromagnetic spectrum (above 470 nm), the yellow ink looks a whole lot like white. And note that the amount of light seen by the M cones is pretty much the same as the amount of light seen with the L cones

So, that, my friends, is what the spectrum of yellow looks like. By the way, the CIELAB (L*a*b*) value is 94.04, -6.07, 116.18.

Example 2

For my next encore, I show the spectrum of a hypothetical yellow LED. I say hypothetical because this isn't an actual measurement, or even a typical measurement provided by the manufacturer. I started with the spectrum of an amber LED, fit a Lorentzian function to it, and then adjusted the wavelength and width just a little to make it the same color as the yellow ink. The CIELAB value of the hypothetical yellow LED is 94.04, -5.99, 116.19. By fudging the LED a little, I got the color within a tenth of a deltaE. 

The spectrum of a yellow LED, along with the sensors in the eye

One thing I should mention about the graph. I scaled the plot of the LED by a factor of about four, just to make it fit with the rest of the plots. In terms of the real real world, I turned up the LED so that in one narrow range of the spectrum it was about four times as bright as the ink, but on the whole, the color -- what the human eye would see -- was nearly identical.

Once again, we see that the amount of light that is seen by the S cone is minimal. The light from the yellow LED is seen in the L and M cones, and in something like equal measure.

So, forget what you learned in that last section. This is the true spectrum of the color yellow. It is a slice out of the yellow part of the rainbow.

Example 3

For my second encore, I will perform the same act of creation of a color that looks indistinguishable from the yellow ink. This time, I will do it with not one, but with the heretofore unimaginable quantity of two LEDS!  From my bag of hypothetical LEDs, I draw a red and a green LED, and mix the light emitted from them. I used an ordinary whisk, but you could certainly use a Kitchen Aid. You can plainly see the peak emission of the LEDs at 555 nm and at 640 nm. 

The spectrum of a mix of red and green LEDs, along with the sensors in the eye

By a small act of hypotheticalry, I managed to adjust wavelength and peak width of these two LEDs so as to get these two LEDs to emit light with CIELAB value of 94.04, -6.05, 116.55. I will admit that I did not get quite as close to the original color of the yellow ink. I got tired of futzing with the hypothetical parameters of the hypothetical LEDs. But, the colors are still close enough to call a really darn good match. And it really could have been perfect if I wasn't so darn lazy.

Oh... remember that thing I said about scaling the plot in the previous one to protect the innocent? The same holds for this one.

At the risk of repeating myself, I will recount what the cones see when they gaze upon this pair of LEDs. It's the same as before. No S, and about an even amount of L and M. 

So, once again forget what you learned in the two previous sections. This bimodal spectrum with two humps is the only real and true spectrum of the color yellow. This Bactrian spectrum is the actual spectrum, and the Dromedary from the previous section is nothing more than a figmentary pigmentary unicorn. And that first spectrum that's as flat as my head? Fahgeddaboudit.

Will the real yellow please stand up?

I hope that I'm not the only one who is confused. I have given three different spectra. And I have claimed in each case that the spectra represents the "correct" version of the spectrum of yellow. 

The versions of yellow

My favorite scene from Fiddler on the Roof has Tevye talking in the courtyard with some of his friends. The first guy says that Obama has brought prosperity to the country. Tevye says "Yah, you're right." The second man in the square says that Obama has completely ruined the country. Tevye stroked his beard and once again says "Ahhh... you're right." The third gentleman questions Tevye, "How can they both be right?!?!" To this, Tevye strokes his beard and says "Ahh yes... you're right!"

How can all three of these spectra claim to be yellow? Which one is the true yellow, and which two are the impostors?  Fear not. None of them are impostors. They are all spectra of yellow. All three spectra would be perceived by the eye as being yellow, and (to a pretty darn close degree) all three are the same exact shade of yellow.

Consider the silhouette below. Is this woman holding a ball? Could be. Maybe this woman is holding a manhole cover? Could be. Or then again, maybe she is holding a garbage can. That could also be. From this view, we can't tell. The silhouette has projected the three dimensional shape down to two dimensions.


Ball? Manhole cover? Garbage can?

This is happening when we see colors. We like to think that we see the whole spectrum from 400 nm to 700 nm, and we kinda do. I mean, there are no holes in the rainbow, right? But our eye only has three sampling points. Mathematically, we would say that the cones of the eye are performing a projection of an infinite-dimensional vector in spectral-space onto a three dimensional space. 

If the whole idea of infinite dimensions is a bit hard to fathom, that's ok. I don't understand it either. Suffice it to say that are eyes don't individually perceive every little slice of the whole spectrum. There is considerable data loss, so there are cases of dissimilar spectra that will look like exactly the same color.

And that's what metamerism is all about. "Yellow" is not a certain spectral curve. Yellow is what we perceive when the S cone has little response, and the L and M cones have high and nearly equal response.

Tuesday, June 10, 2014

Scribbling away that scratch on my car

I received an interesting comment/question on a LinkedIn thread about the Scribble pen. Answering this question provides me the opportunity to touch on a number of topics and color science, as well as the opportunity to show off just how incredibly smart I am. Since both of these are high on my list of things to do, I decided to dedicate a blog post to answering his question.

Malcolm Cutting
Malcolm
Paint & Development...looking for challenge to develop your business. Call me.
Just using imagination here and the touch up pen for the automotive smart repair scratches....now that could be quite possible.....or could it? Worth thinking about.





The short answer

No.

Requirements are tough

Malcolm is one of my oldest and dearest friends. I just met him on LinkedIn about 15 minutes ago. Feel free to draw your own conclusions about my track record with friends. From reading his LinkedIn profile, I know that he has been in the automotive coating business for multiple decades. He knows that matching paint on a car is one of the most demanding color applications, if not the most demanding.

The first issue is that on a scratch, you are trying to match two colors that are side by side. The human visual system (which includes those parts of the brain that are not devoted to memorizing every episode of Laverne and Shirley) is also very good at picking up on coherent anomalies, such as a line.

Juxtaposition accentuates color differences

The second issue is one that most of my readers are aware of. If you are successful enough in life to have access to the internet, then it is almost certain that your car is more expensive than mine. Naturally, we want our cars to look expensive to show that we are indeed more successful than some dufus who turns to blogging to feed his massive ego. Most of us express our identity through the cars we drive.

Would Guy Fieri still be cool in a Saturn?  I think not.

In short, people are picky about touching up scratches on their cars.

It has to be the same color

Naturally, when a scratch is retouched, it has to be the same color. In order to make it the same color, we need to measure the color accurately. Back in the days of Moses and Pythagoras it was done with the eyeball of someone who is both discerning and not colorblind. Ideally, this person would have been more discerning than the most demanding of customers. 

Nowadays, critical color matching is sometimes/usually/always done by expensive spectrophotometers, which are sometimes/usually/always more discerning than the most demanding of customers. I suspect if you go round and chat up the guy who does that painting at the local body shop, you'll find that he needed to go back to college to pick up a PhD in astrophysics (or some other branch of astrology) just to be able to run a spectro.

The kid who paints my bumpers 

The Scribble pen? It uses an RGBC sensor. Four channels. That's it. The standard ISO 13655, which provides the definition for a color measuring device in the graphic arts, requires that a spectrophotometer be used, and that the spectrophotometer must have at least 15 channels, and preferably 31. I ain't know arithmetic guy, buy I think 3 or 4 is less than 15.

In my own personal experience, I spent about two years working with a bunch of smart guys trying to teach an RGB camera to accurately measure color. Here is one of many papers I wrote about this sad experience:
Why do color transforms work? And here is another: Color measurement with an RGB camera. I have seen a lot of claims about this, and it burns my butt like a candle on a toilet seat. If you want discerning color measurement, you can't use RGB to measure the color.

The color must match under any lighting

In order to be happy about the matching of the color on a scratch, most car owners (I think) would want the match to be good wherever the car is. The illumination could be direct lighting from the Sun, diffuse bluer lighting from the clear sky, the incandescent lighting from one of the bulbs in my garage, the fluorescent lighting from the other bulb, and the sodium vapor lighting you see in parking structures. 

This may seem like no big deal, but those who have practiced saying the word metamerism will realize that this is not a given. It is possible for two objects to match under one lighting, but not under another. If you don't believe me, try to guess the color of a vehicle in a parking structure at night. If you want to match a color under all lighting, you will need to do spectral matching and you will need a lot of different pigments.

The RHEM indicator

The Scribble pen, as cool as it is, only has four pigments: cyan, magenta, yellow, black, and white. Or maybe that's five? I'm a math guy, not an accountant. Spectral matching is pretty much out of the question.

Hmmm... Metamerism might be a good topic for a future blog. Look for it at your favorite blog sites.

The color must match at all angles

If you were impressed by my use of the word "metamerism", I introduce another important-sounding word: goniophotometry. If you can slip those two words into casual conversation, you can pretty much bluff your way into any of those wild color science parties that you are always hearing about. Goniophotometry is the measurement of light when you change the lighting and viewing to different angles. When you reposition the lighting, or move your head around, there is a subtle or sometimes huge change in the color of an object.
The simplest example of this effect is something that is so ubiquitous that it probably goes unnoticed. In fact, I am going to guess that I might get some arguments about whether this is even a color change. I'm talking about gloss. When you view a glossy object at the gloss angle, the color of the object changes. 

This is a point where there might be some argument. One might argue that the color of the object didn't change just because of the angle of lighting and viewing. I would argue that the composition and intensity of the reflected light changes drastically at the gloss angle. 

For the purpose of our discussion, gloss is important. Would you say that a touch-up paint matches another if there is a difference in gloss? I think not! Once again, as cool as the Scribble pen is, it does not have a mechanism to adjust the gloss of the ink.

Metallic effects are another example of goniochromism (when color depends on angles of lighting and viewing). Cars often have a metallic paint. This is achieved by embedding flakes of metals within the paint, laying the paint down in thin layers to make sure that the flakes land flat, and polishing the heck out of it between layers. (This is my understanding... I am open to hearing an explanation from someone who has actually painted a car before.)

Painting a car is an exacting science

The Scribble pen, as cool as it is, does not include any metallic flakes. Nor does it include a polishing thingie. So, I am gonna guess that metallic effects might be a bit tough with this pen.

The creation of gloss and metallic effects are two areas where this pen, as cool as it is, is gonna fall short of the requirements for fixing my paint job when some mathaphobe keys my car. But I skipped over another missing feature. The Fix-The-Scratch-In-My-Car pen must also be able to measure the goniophotometric properties of the existing paint. Some cars are metallic and glossy. Some are just glossy. Other cars, particularly those left outside in Arizona, have lost some of that gloss. Some cars, such as mine, which reside in areas where they use salt on the streets to melt ice, have a glorious texture where a dull rust color is interspersed with the drab shade of pale lavender greenish orange. 

As I understand it, the big car companies use a goniospectrophotometer for quality control of their paint process. Such an instrument runs something over $100K and measures the spectra of reflected light at a zillion and a half different angles in order to make sure the color is correct from all angles. These are run by more astrophysics PhDs.


Now, I could have that wrong. Maybe the big car companies use an abridged goniospectrophotometer, such as X-Rite's MA98, for quality control. Rather than a zillion and a half angles, these instruments make measurements at maybe 20 or 30 different angles. These instruments probably make more sense on the production line, since the measurement time is on the seconds, rather than minutes or hours.

The Scribble pen, as cool as it is, probably does not include even an abridged goniospectrophotometer. If it did, the price would be pretty cool, since the abridged gonios cost around $25K. 

Still more

There are a few more requirements for a Fix-The-Scratch-In-My-Car pen. Someone should probably mention that there is a difference between ink and paint. Ink is transparent. Paint is opaque. You want to paint your car with paint, since the bare metal is not all that nice looking.

Someone should also mention that the paint has to be durable. Durable enough to stay put under the effect or driving rain, beating sun, slush, and sandstorms. My wife also tells me that there are these places called car washes where these sudsy rollers come out to rub the grime off your car. The only place I am aware of like that has rollers who are wearing bikinis.

And then someone might wanna mention that it would be good if this pen could avoid scratching the car? I don't have all the details on the Scribble pen, but one possible implementation of the inking mechanism has an ink jet head spraying the back side of a ball point.

Conclusion

Malcolm, I think you got a cool idea there. I'm thinking the Scribble pen might not quite be up to the task, though. But, if we loosen up some of the constraints that came from making this device a handheld pen...