Showing posts with label ink. Show all posts
Showing posts with label ink. Show all posts

Wednesday, October 23, 2013

Color Picker Pen

(An update to this blog post can be found at "Scribble Pen".)

As John the Math Guy, people are always asking me stuff. Often the questions are like "When are you gonna get off that darn computer and fix that leaky faucet?" Or "Why are you so ugly?" These, of course, aren't really question at all, but every once in a while I get a real question. Today, the question was "how does this gizmo work?"

The gizmo in question is called the Color Picker Pen, designed by Jinsu Park. Lemme tell you, it's pretty cool.

You start by holding one end of the pen up to an object and clicking the color scan button. A color sensor measures the color of that object. In the picture below, the pen has picked up the green of the leaf, and note that the color display (along the side of the pen) has changed to indicate green.

Grab a color

So far, this is a cute little gadget. But now the real fun begins. This is a pen, right? The really cool thing is that you can now use the pen to write with whatever color you just scanned. Kind of like the Photoshop eyedropper tool, only it works in the real world rather than in the cyber world within Photoshop. (You know, where all models are a size zero, and don't have pimples or cellulite?)

Draw with that color

Wow!

But I was asked to explain how it works. The answer is simple. It doesn't. Don't get me wrong. It's a great concept, a cool idea, but, at least as shown in the diagrams, it seriously won't work. And, it was never advertised as a real product. Actually, you can find a lot of websites by googling "color picker pen", and many of them refer to this as a "concept", an idea that has not been turned into a real product. 

Internal organs of the Color Picker Pen


The sensor

The sensor for this pen is plausible. There is a color sensor available from MAZeT that would fit the bill. This is a true XYZ sensor, which means that it is a bit better than an RGB sensor in terms of color fidelity. (An RGB sensor will see some colors distorted.)  The sensor itself is shown above... certainly small enough for the color picker pen. Below the sensor is a prototype board. At the right side of the board, you will see a USB connector, so that gives you an idea of the size of the board. If you remove the USB related components on the board - which would not  be needed - you might be able to fit the board into the end of a fat pen.

MAZeT sensor and prototyping board

Of course, a few things might be missing. If I were designing this, I would likely try to add a white LED because I wouldn't trust ambient light, which can vary in intensity by many orders of magnitude. And especially since the user would generally want to push this thing right up against the leaf, effectively shielding the leaf from any ambient light. But this LED might make the whole thing too large, since it would be necessary to shield the sensor from the LED.

There is still one thing that is bothering me about the sensor, though. Below I show a closeup of the sensor end of the pen. Anything funny about it? Think now. What color is the end? It's a dark gray?!?!?  Why would an optical designer put sunglasses over a color sensor? It's pretty dark. Just taking a wild guess, I would say that it reduces the light to the sensor by a factor of 10. Not a good thing.

Close up of the sensor end of the Color Picker Pen

So far, it sounds like this could perhaps be built, but that it is unlikely that the pictures represent a real design.

The display

The Color Picker Pen offers a nice feedback feature: the pen will light up to tell you what color ink is measured / loaded. Is this feasible?  I borrowed a pen that belongs to my wife to show that, yes, such an animal exists. Those of you who know my wife, I would appreciate if you didn't mention that I borrowed her pen. I told her I was going to be fixing that leaky faucet.

Pen for writing love letters in the dark

This pen has a battery and a blue LED. Clicking the switch on the top will turn the light on or off. This could easily be done with a tricolor LED so that a wide range of colors can be produced along the side of the pen.

The battery in my wife's pen reminded me of something else that is needed. In my palpable excitement over this pen, I forgot all about the need for a battery! I didn't see a place for one, or a way to replace it, but let's just say that could be done. Since there is no evident way to replace a battery, it is sounding more like this is a concept design, and not a real product or prototype.

The other electronics

Of course, maybe there needs to be a microprocessor as well? Ok... I guess we can make some space for that. Maybe it would fit? I dunno.

The inks

Now we come to the fun part. The ink. Once again, I have taken a close up of the internal organs shot. Quite clearly, it shows a red, a green, and a blue ink cartridge. That's where the color scientist in me immediately says "nope, not a real product".

Close up of the ink

Why do I say that? Well.... Lemme ask you a question. What color inks are used in your home printer? Red, green, and blue? Nope. Sorry. They are cyan, magenta, and yellow. Below you see the four printing inks from my home printer. Cyan, magenta, yellow, and black. No red, no green, and no blue.

The inks for my printer

Perhaps I just have a cheap printer, you say? Well, that's true, but let's consider the other end of the spectrum. I put my latest Boston Proper sales flyer on my scanner, and collected this image. Note, especially in the white of her alluring eye, that there are no red, green, or blue dots. The dots are cyan, magenta, and yellow. The printing press that this was printed on cost a little more than my home printer - I dunno the exact figure, but I am putting it around $10 million. They don't use RGB inks. 


The choice of CMY (with the addition of black) over RGB is a fascinating story. I will get around to telling it sometime soon. For the time being, let me say this. If you mix red and green ink, you get a dark and dirty brown, almost black. If you mix red and blue ink, you get a very dark blue, almost black. If you mix green and blue, you get another really dark color. So, mixing RGB inks, you can make red, green, blue, and three lovely shades of black.

Let's change up the inks. If you mix cyan, magenta, and yellow, on the other hand, you can get a whole bunch more colors. Cyan and magenta ink mix to make a purplish blue. Cyan and yellow make green. Magenta and yellow make an orangeish red. If you mix all three inks, you get a dark brown, almost black.

So, my assessment of the Color Picker Pen is that no one ever built one. If they had, they would have realized that red, green, and blue don't make for a very wide collection of colors. They would have then called John the Math guy to help them figure it out and I would have recommended cyan, magenta, and yellow. Since I never received such a call, I have to assume that the Color Picker Pen was never built.

So, why are color cameras RGB? And why is a computer display and a TV RGB? Questions, questions! I will leave them for another blog!

Wednesday, September 4, 2013

Mixing my ink with my beer

I have had a lot to say in the John the Math Guy blog about beer. There was a recent post about ruminations on beer, but the key post on beer, my seminal post on beer, is the post where I cleverly used beer to illustrate Beer's law. I keep going back to that one because I just can't get over how brilliant the idea was.

I have referred to this Beer's law post in heaps and gobs of other posts:


Green ink being shamelessly added to beer

Several people have asked questions on this Beer's law thing, and how it connects with ink. Way back in January (2013), I got an email from a PhD student in the UK:

When I scoured the internet for the derivation of this equation I only found the original equation based on absorption coefficient, path length and concentration.

I would like to understand where the alternative equation is coming from. Could you point me in the direction of a useful paper or similar? Any help would very much be appreciated. Thanks a lot in advance.

Kind regards,
Anja

I just recently got a similar question from Michael, who is not a PhD student in the UK, but is nonetheless a smart guy. He just aced the Science and Technology Quiz that was put together by Smithsonian magazine and the Per Research Center. This is quite an accomplishment. I'm proud to be a "virtual" friend of yours, Michael.

I thought Beers law was related to transmission of light through something, not reflected - but, well, same difference ?

Michael's question came to me on through that website that everyone uses for scientific collaboration.: FaceBook. If you haven't heard of it yet, I suggest you check it out. That's where I do most of my serious research.

The plethora of questions (there were two...) show that I have clearly messed up big time in my desire to educate the world about ink and beer. I left one little step out, the mixing of ink and beer. Just how is it that Beer's law applies to ink?
Beer (on the left) and ink (on the right)

Ink is soooo not like paint

One of those wonderful things that we can count on in this world is that paint is not like ink. Oh... they may seem the same to the untrained and unscientific eye. You put them on something and it changes the color. But there is one key difference, as illustrated in the image below.

This time, paint is on the left and ink (on the right)

This image was created by smearing ink and paint on a sheet of paper [3]. Before smearing, a large black area was printed on the sheet. Note that on the left, the paint completely obliterates the black underneath. Paint has a great hiding power, at least when you pay more than $8 a gallon for it. The ink, however, does a perfectly lousy job of hiding the black. You really can't tell that the yellow ink is overneath the black.

What gives? Is ink just really, really cheap paint? Oh contraire! Let me assure you, ink does a pretty decent job of doing exactly what it was trained to do. And paint also does a pretty decent job at what it was trained to do. That is, if you aren't cheap like me, buying the ultra-cheap paint at $8 a gallon from Fast Eddie's Paint Emporium and Car Wash.

The actual photomicrograph below illustrates what an ideal cyan ink is trained to do. Red, green, and blue light hit the surface of the ink. [4] As can be seen, the blue and green light go right through the cyan filter ink. The ink is transparent to green and blue light. These two flavors of light hit the paper (or other white print substrate) and reflect back. Why? Cuz the substrate is white, and that's what white things are trained to do. 


Cyan ink, sitting contentedly on paper while being bombarded with red, green, and blue light

The red light suffers a completely different fate. For anyone who has visited a red light district, this should be no surprise that one's fate may change. The red light is absorbed by the cyan ink. Few of the poor hapless red photons ever even get a chance to reach the paper, and even fewer make it through the ink in the hazardous journey back through.

I may have shattered some illusions about ink here. I apologize, but it's time you learned the facts about the birds and the bees and the inks. It is customary to think of light just reflecting off the ink. Sorry. It's more complicated than that. The only reflecting that's done is done by the paper.

Ink is a filter, a filter laid atop the paper.

Why is ink that way?

This bizarre behavior is not just some side effect of some bizarre organic chemistry that is only understood by some bizarre color scientist locked in the lab at Sun Chemical. This bizarre behavior is a property that is specifically engineered by some some bizarre color scientist locked in the lab at Sun Chemical. 

To see why this would be a good thing to engineer in, consider what happens when magenta ink is placed overneath cyan ink. Magenta ink works a lot like cyan ink, except that it absorbs green light and passes red and blue. The excitement starts when you put on ink on the other. The cyan ink absorbs red light and the magenta ink absorbs the green. What's left? Just blue light.

Magenta ink, sitting contentedly on cyan ink

The exciting part of this is that new colors are created. We start with cyan, magenta, and yellow inks. By putting one ink overneath another, the additional colors red, green, and blue are created. Try doing that with paint! It ain't gonna work. The paint on top defines the color, hiding whatever is below. 

This feature of ink is what allows us to have a much wider gamut. With three inks (cyan, magenta, and yellow) we can theoretically get eight different colors: white (no ink), cyan, magenta, yellow, red, green, blue, and black (all three inks).

Getting a bit more quantitative

I need to put some numbers on this if I'm going to get Beer's law involved. I painted a rather black and white picture of cyan. Well, ok, I should say that I inked a black and white picture rather than painted it. And black and white aren't quite the correct colors. But, the point is, inks are not perfect. Cyan does not capture all the red photons. Nor does it pass all the green and blue photons.

 A typical cyan ink might allow 20% of the red photons to pass through on their way to the substrate. That is, 80% of the red light gets absorbed and the other 20% makes it down to the paper. Let's just assume that all of those photons reflect from the paper. (I am telling a little white lie here, but it's for a good purpose.) 

Ok, so if we start out with 100 red photons heading downward into the ink, 20 of them will reach the paper. Of these 20, 80% of them (I think that would be 16) will get absorbed on the way up. That leaves just 4 red photons, out of the original 100, that make it back out. For those of you who are all into the density thing, this would mean about 1.40D. If you understood that, then you know Beer's law, and can apply it to ink on paper. Who said that ink and beer don't mix?

--------------------------
[1] You may have seen this blog post in Flexo Global Magazine. So, we are talking popular here.

[2] I am pleased to say that this blog post was picked up just recently by the Australia New Zealand Flexographic Technical Association magazine (August 2013). Look for it in your mailbox. This blog post was also picked up by Flexo Global magazine. So... we are talking really popular here.

[3] Truth in advertising here... this is not an actual photo, but a digital simulation. It is very nearly photorealistic due to my vast artistic ability, and it simulates what really happens, but I repeat, this is not an actual photo.

[4] Someday I will get around to writing a blog about how light comes in three flavors: red, green, and blue. That's all. All other colors are a combination of those three. Based on this simplification, you can explain why inks are CMY and computer monitors are RGB. It will be a totally cool blog. I will send you a text when I finally publish it.

Wednesday, March 27, 2013

"Density is ink film thickness"

I've heard it said thousands of times. Solid ink density tells you how thick the ink is, and CIELAB tells you the color. Along with this goes the converse: solid ink density does not tell you color, and CIELAB doesn't tell you the amount of ink. I'm writing this post to set the record straight. There is nothing fundamentally different between density and CIELAB, except that there is less information in density.

The start of the scandal

I admit to my own little contribution to this scandal. I have talked about Beer's law. Incessantly. I even wrote a blog about Beer's law. In hindsight, I realize that I should have just stuck with Wien's Law [1]. But there it is, I ordered the Beer.
Beer's law, or Wien's law?

I didn't mention ink in that particular blog, but it wasn't long before I started having a little ink with my Beer. In one post, I used Beer's law to explain why ink sometimes changes in hue when you slather it on. As if that wasn't enough, I pulled out another six-pack to describe how to reach a CIELAB target when all you have control of is ink film thickness or pigment concentration.
Image from the world famous perifarbe blog post

Let's have a look at each of the four myths and see how they stand up.

Myth #1 - Solid ink density is ink film thickness

Now, if there were laws about truth in blogging, I woulda probably shoulda mentioned that Beer's law is a decent approximation, but there are some other things going on that limits it a bit when we are talking about ink.

Beer's law (when applied to ink) assumes that light enters the ink, reflects from the paper underneath the ink, and then goes back through the ink. The more distance it travels in the ink, the more likely it is to be absorbed. Those are the two fates of a photon: it gets caught, or it makes it out of the ink. The thicker the ink, the higher the probability of getting caught. Beer's law puts no limit on this. Given a thick enough ink, the density could be a zillion. (This would correspond, of course, to a reflectance of one in ten to the zillionth. My densitometer doesn't quite go that high.)

There are, however, two other potential fates for a hapless photon. A photon without much hap could bounce off the top of the ink, never having a chance to see the ink at all. This is called specular reflection. Another fate has to do with transparency. Photons could bounce around inside the ink and eventually find their way back out before even seeing the paper.

These two effects guarantee that there will be at least a few wayward photons that wind their way back to the detector. Thus, this puts a limit to the density, so all good proportionality must eventually come to an end. Buy me a beer some day, and I'll tell you everything you want to know about the Tollenaar-Ernst equation [2].
One of my favorite equations, the Tollenaar-Ernst equation
The T-E equation in action

Conclusion? Myth partly busted. 

Myth #2 - CIELAB does not measure ink film thickness

I presented a paper at the 2008 TAGA conference entitled "Building a bridge from Dense City to Colorimetropolis". The paper was dreck, but I am quite proud of the clever title [3].
Photo-realistic drawing of the San Francisco bridge 

In this paper I showed that the color difference between paper and the solid (in deltaE values) correlates reasonably well with (paper relative) density when measuring cyan, magenta, and yellow inks. My conclusion is that CIELAB values contain all the information that density values do.

It is incorrect to say that CIELAB does anything really any different from density. The only issue is that of the software catching up. If spectrophotometers and offline software packages reported the right numbers in a way that could be readily understood by press crews, then the myth would just plain go away.

Myth busted! Here is the correct statement to replace the first two myths: "Both density and CIELAB are indicative of ink film thickness, but neither is completely true, especially when you get to high density." [4]

Myth #3 - CIELAB tells you the color of the ink

Well, duh. CIELAB is color, right?

Some pedantics might argue that CIELAB is not color, but that CIELAB is a good enough approximation to work for many industries. CIELAB tells you a lot about the appearance of an object, but it doesn't take a lot of things into account, like

  1. The effect of adjacent colors on our perception of an object
  2. The effect of out perception of a white point in our field of view.
  3. Goniophotometric effects such as glossiness, opalescence, and metallic luster
  4. Eye fatigue
  5. Differences  in color vision between people, even among people who are not color-blind

Setting all this sophisticated stuff aside, I'm gonna say that CIELAB is a good measure of what we perceive as color. Myth Confirmed!

Myth #4 - Solid ink density does not tell you the color

All I gotta say is "orange". An orange ink may have exactly the same density as a yellow ink. The blue filter in a densitometer may see exactly the same density on an orange and a yellow ink. But, the orange ink is a different color.

The issue is, solid ink density is only one number, so it can't possibly tell you what the color is. Color is three-dimensional. Well... what if I look at all three density filters, red, green, and blue? A densitometer can report all three of these, right? That gives me three dimensions, so there you go. We have defined the color, right?

I'm gonna say "no". The three filters in a densitometer are different than the three filters in my eye.

Once again, myth confirmed!

My (perhaps unpopular) conclusion

There is nothing magical about density that allows it to put a micrometer on an ink film. Inherently, density and CIELAB are sewn from the same cloth. They are both measures of the reflectance, as measured through specific spectral filters. In one case the filters were selected so as to capture the richest part of the spectrum for specific inks. In the other case, the filters were selected so as to mimic the human eye. Other than that, the only difference is in the math.

If there were just a bit more math applied to CIELAB values to serve as a proxy for ink film thickness, then density would no longer be necessary.

------------------------------

[1] I'm not kidding. Not only is there a law of physics called Beer's law, but there is a law of physics called Wien's law. It says that if you know one black body radiation curve, you know them all. In some sense, they all look alike no matter what the temperature. This is also known as the Wine-goggles effect. After enough wine, all bodies look the same, no matter how hot they really are.

[2] Tollenaar, D. and Ernst, P.A.H., “Optical density and ink layer thickness,” Adv. Print. Sci. Techn., 1962, Bol. 2, pp. 214-233.

[3] I was also proud of the really ornate and detailed drawing, which was my depiction of the San Francisco bridge. The TAGA conference that year was held in San Francisco.

[4] I have an article in the upcoming IDEAlliance bulletin that looks at the traditional Murray-Davies formula for computing dot gain, which is based on the science that went into density measurement. In the article, I show rather conclusively that this paradigm does not work for determining dot gain of spot colors. The density of a 70% for example, is nearly identical to the density of the solid, when it is clear that the 70% and the solid have different CIELAB values.

I don't yet have the data to come to any conclusion about the relationship between density and ink film thickness for spot colors, but I suspect that the same sort of thing applies. If one looks at the density/ink film relationship at the wavelengths with highest density, I suspect that these too will reach a saturation point long before the color stops changing.