Category Archives: technology

Colour Matching and Cones

Earlier today I posted something on quora about who many colours there are. It’s quite a long post. You can read it here. However, if you want the short cut the answer is 3-5 million. 🙂

However, I also linked to the post on LinkedIn and someone asked me a question about the relationship between colour-matching functions and cone sensitivities so I thought I would make a new post today about that topic. I have used my message on LinkedIn as the basis for this post but modified it a little to make it suitable for general consumption.

Here are two diagrams:

This shows the actual spectral sensitivities of the MLS cones in the human eye

The 1931 CIE XYZ colour-matching functions

It’s another common misconception that people get these two diagrams confused. The cone spectral sensitivities are the actual sensitivities of the cones in the eye. Although people often say that the eye responds mainly to red, green and blue light, it’s not so simple.  In 1931 the CIE measured the colour matching functions. One of the reasons that they did this was that in 1931 we didn’t actually know what the cone spectral sensitivities were; these were only known for sure in 1964. So in 1931 the CIE measured the amounts of three primary lights that an observer would mix together (additively) in order to match a single wavelength of light. And they did this for each wavelength. The second of the diagrams above shows the amounts of each of the primaries needed to match each wavelength on the spectrum.  Originally, the CIE used three lights (these were RGB)  or primaries. However, they mathematically transformed their RGB colour matching functions to create the XYZ colour matching functions. These are sometimes also known as the CIE colour matching functions or the CIE standard observer.

These are the original CIE RGB colour-matching functions

The point of these (XYZ) colour matching functions are that they allow us to calculate the CIE tristimulus values XYZ of an object if we know the spectral reflectance of the object and the light it is viewed in. The XYZ values are the amounts of the three XYZ primaries that an observer would, on average, use to match that object viewed in that light source. If two samples have the same XYZ values then they are a visual match; because an observer would, on average, use the same amounts of the XYZ primaries to match each. And this was the whole point of the CIE system; to determine when two colour stimuli are a visual match.  Had we known the cone spectral sensitivities in 1931 it’s possible that history would have taken a different course and that instead of having CIE XYZ we would simply calculate the cone responses LMS. And we could say that if two samples have the same cone responses they are a visual match. But I guess we’ll never know.

Now, if two samples have the same XYZ values then they will have the same cone responses. This is a bit technical but this is true because the cone spectral sensitivities are a linear transform of the CIE XYZ colour matching functions. They are also a linear transform of the CIE RGB colour-matching functions.

The colour-matching functions depend upon which primaries are used whereas the cone spectral sensitivities are more fundamental. Doesn’t this make the colour-matching functions arbitrary? Not really. Although the actual shapes of the colour-matching functions depend upon the actual primaries used, the matching condition does not. If two samples generate the same cone responses then the observer would match them with the same amounts of the XYZ primaries and the same amounts of the RGB primaries.

On this page – https://en.wikipedia.org/wiki/CIE_1931_color_space – you can see the cone spectral sensitivities and the RGB and XYZ colour matching functions.

EU ban on coloured tattoo ink

The European Chemicals Agency (ECA) have announced bans on certain coloured tattoo inks from January 2022.

Tattoo inks and permanent make-up often contain hazardous substances that cause skin allergies and may even be carcinogenic. Ink pigments can also migrate from the skin to the lymph nodes and the liver. Even the removal of tattoos can be dangerous because the laser that is used may break down the pigments into smaller substances which may themselves be dangerous.

Safer alternatives are not available for two particular pigments: Pigment Blue 15:3 and Pigment Green 7. These pigments are both copper complexes and are also known as Phthalocyanine Blue and Phthalocyanine Green. The ban will be enforced by Registration, Evaluation, Authorisation and Restriction of Chemicals (REACH) who may give ink manufacturers a year to find safe alternatives for these two coloured inks according to some reports. Some people doubt whether the restrictions are really necessary and here is a video from the perspective of a tattoo artist. And here is an open letter of concern from the European Society of Tattoo and Pigment Research.

There is a need for more research and a greater understanding of the effect of these tattoo inks on the body and especially the long-term effects.

Colour Intelligence

It’s quite exciting to announce that this week I founded Colour Intelligence with my colleague Dr Kaida Xiao. We have some quite exciting things planned. It’s my second time running a start-up. I formed Colourware Ltd in about 1994 and I only stopped running that company when I became ultra busy at Leeds University in my professorial role and when I was also Head of School of Design. I can’t say any more about what we have planned just now but hopefully I will be able to do that soon.

ColourMyIdeas

For quite a long time I have been working on the relationship between colour and meaning. A lot of very good research has been carried out over the last few decades in this area. Typically, in this research, people are shown a colour and asked to respond what they think about it on a bi-polar scale; for example, is it warm or is it cool. Or, is it modern or is it old-fashioned. This research is very nice but in my opinion we should turn the problem on its head. Rather than asking what we think about a colour we should ask which colours do we associate with warm, which colours do we associate with modern, which colours do we associate with happy. There are several reasons for this. One is because I would like the research to be useful to, for example, designers. Designers don’t typically start with a colour and wonder what that colour represents. Rather, they might start with a brief that includes some concepts, such as modern and financial and think start to explore which colours might represent (or communicate) those words or concepts. It’s great to do this sort of research in the lab. However, I would really like to be able to generate a colour palette for any word or concept and it is clear that we can’t run costly and laborious lab experiments for every word (and for every word in every language actually).

I worked with a major paint company to automatically generate colour palettes for words using large-scale internet scraping following by machine learning. We have a pilot website with results for a few words. It looks like this.

Word–>Colour

You can see this pilot website here.

Another way to get lots of data about this topic is using crowd sourcing. We have also been doing this and you can read our latest paper about this in the Journal of the International Colour Association. Details of this paper are shown below:

Chen et al., 2020

Why yellow and blue don’t make green

[and why we should stop teaching it in schools]

You will find images like the one above, that show that red, yellow and blue are the primaries and that yellow and blue make green.

Sometimes this is represented as a colour wheel:

So some people say yellow and blue make green. And you will find other answers that say that yellow and blue make black. How can this be?

Well, we need to understand a little science to get to the bottom of this.

The figure below shows what happens when you mix an ideal yellow dye with an ideal blue dye. The blue dye reflects light perfectly in about a third of the spectrum (and absorbs perfectly in the other two thirds). The yellow pigment reflects light perfectly in about two thirds of the spectrum (and absorbs perfectly in the other third).

The problem here is that the blue and yellow pigments (between them) absorb perfectly across the whole spectrum. The people who say that yellow and blue make black are saying so because of this argument.

Note that blue is a particularly bad choice of primary because it absorbs so broadly across the spectrum. [Making the blue even purer would only make the problem worse by the way.] Yellow is a good choice of subtractive primary because it only absorbs in one third of the spectrum.

The problem is, the people who say that blue and yellow make black are wrong of course. Every child knows this. In practice, if we measure the reflectance spectra for blue and yellow pigments they don’t look like those ideal ones I showed above. For a start, they are quite smooth. Here is a reflectance spectrum for a real yellow pigment. (The reflectance factor, by the way, is the proportion – or per cent – of light that the colorant reflects at each wavelength.)

Notice that with a real yellow colorant, it does not reflect perfectly in the middle and long wavelengths and it does not absorb perfectly in the short wavelengths. It reflects and absorbs to some extent all the wavelengths but it absorbs more at the shorter wavelength and absorbs at less the middle and longer wavelengths. The same is true of a real blue colorant; it does not absorb perfectly at the middle and longer wavelengths. The consequence of this is that you don’t get black if you mix blue and yellow. You would get black if the pigments were ideal but they are not. We live in the real world. However, you certainly don’t get a lovely bright green as shown in the colour wheel with red, yellow and blue primaries. You would get a dark desaturated murky dirty greenish colour. The main reason for this is that the blue is absorbing too broadly. Interestingly, if you look at the artist John Lovett’s page he explains that to mix a yellow and blue you should use a yellowish blue (and a bluish yellow). 

Now let’s see what happens when we mix cyan and yellow dyes. We’ll start with the ideal colours.

It’s very nice. We get a lovely green colour. Cyan is a great subtractive primary because unlike blue it absorbs in only one third of the spectrum (the red or long wavelengths). Note that it is precisely because the cyan does not look pure that makes it a great primary – that’s why I get so furious about people saying the primaries are pure colours. The cyan looks bluish-green because it reflects in two thirds of the spectrum and only absorbs in the reddish part. Neither the cyan nor the yellow dye absorb in the middle (green) part of the spectrum and therefore the result of mixing cyan and yellow is a lovely green. Except it is not quite true. Remember, this is for ideal pigments. Real dyes do not look like that. Refer back to the measured reflectance spectrum for the real yellow pigment. In reality cyan and yellow do make green but the green might be a little less saturated than you may wish for because of the unwanted absorptions by the two dyes in the areas of the spectrum where ideally they would not absorb. (It was the great Robert Hunt, who worked for many years at Kodak – for those who knew him – who taught me about unwanted absorptions.)

Have you ever seen this happen. Of course, you have. Whenever you use a printer (which typically uses cyan, magenta and yellow primaries) to get a green, the printer is using cyan and yellow to make the green.

Remember those people who say that you can’t make blue because – yawn – it’s a pure colour that can’t be made by mixture? Well, have you ever printed out blue on a printer? Of course, you have. Let’s look again at our ideal primaries and see if we can explain it.

That’s right. Mixing cyan and magenta makes blue. The cyan absorbs in one third (the red third) and the magenta absorbs in one third (the green third) but neither absorb the short wavelengths.

John Lovett explains that you can do a decent job of mixing red, yellow and blue dyes, but only if you allow yourself to use multiple blues and multiple yellows, for example. If you want to do the best job possible using only three subtractive primaries, then the best you can do is to use cyan, magenta and yellow. 

So finally you can see that the best subtractive primaries are cyan, magenta and yellow because the cyan is red absorbing, the magenta is green absorbing and the yellow is blue absorbing. And what is more, you now understand why this is the case (rather than accepting dogma). You also understand why there is a relationship between the CMY of subtractive mixing and the RGB of additive mixing.

The optimal additive primaries are red, green and blue (I will cover this elsewhere). And for this reason the optimal subtractive primaries are cyan (red absorbing), magenta (green absorbing) and yellow (blue absorbing). 

But don’t be fooled by this lovely subtractive colour mixing diagram. You might not get such lovely blue, green and red colours when you mix real CMY primaries (either on your printer or with inks/paints). Why not? Because of the unwanted absorptions.

If you want to to know more you could do worse that get a copy of Measuring Colour, now in it’s 4th edition, and authored by Hunt and Pointer. 

This post gets quite a few hits so I will take this opportunity to direct you to my short series of youtube clips that describe the issues discussed in this post in a visual way. You can see them here. If you want something a bit more technical check out this short lecture on colour primaries or visit my patreon.

Or visit my Patreon page here for more analysis like this

Has technology for Harry Potter’s Daily Prophet just arrived?

I believe that print as we know it is dead. I know that there are some arguing that print is having a resurgence – just as there are those who think that vinyl is on the way back for music – but reports that physical books are gaining ground at the expense of digital are just plain wrong as is explained in this article. I saw this before with digital images where people argued that digital images would never replace traditional photography because of quality and price. Well, of course, we know that the quality of digital images increased and the cost of getting them decreased (when I was a student in the 80s it would have been bizarre to imagine that everyone would have a couple of cameras on them at all times) – but it was not this that killed traditional photography and eventually put the giant Kodak out of business. What killed traditional photography was when you could go to a gig, take a photo, and share it almost instantly with your friends around the world. Traditional photography could never compete with this.

Some people prefer reading print to looking at a screen though I am not one of them. But imagine when an e-document feels like paper, is light and flexible, but you can carry a whole newspaper with you (not to mention all the novels you have ever read) by carrying just one piece of it. And it looks just like print.

E ink, the company behind the pigment-based, low-energy monochromatic displays found in many of today’s popular readers has worked out how to create up to 32,000 colours using almost the same technology. For the first time they can create colours at each pixel using yellow, cyan, magenta and white pigments. The new display is 20-inch with 2500 x 1600 resolution. The image below is rendered in this way. This leads to the possibility of having coloured moving images made out of ink – just like the Daily Prophet in the Harry Potter movies. Well, not quite like that yet. But it’s coming. More details here.

ink

light that changes colour with your mood

LED-Smart-Bulb-silver-715x400

The future of lighting is LEDs and that means more colour. There are many advantages of LED lighting over tungsten or even fluorescent lights not least of which is the opportunity for more colour. I have noticed all of the new buildings on the campus at the University of Leeds are equipped with coloured lighting. The Laidlaw library – and even the new car park – is illuminated at night in an eerie purple glow.

The Syska SmartLight plugs into a standard socket but then can be controlled using the “Syska Rainbow LED” app for your Android or iOS phone or tablet.

I want one. But I am not sure they are on sale in the UK. More details here.

RGB displays are more complicated than you think

Nexus_one_screen_microscope

Most people assume that display screens are based on RGB – that is the amount of red, green and blue light emitted is controlled in three signals. We tend to think that there is an RGB ‘value’ at each pixel. However, the reality is a bit more complicated. The picture above is a close up of the sort of display on the Samsung Galaxy S phones, as well as the Nexus One. It is called an RGBG pentile layout. This layout was introduced because our eyes are more sensitive to green light (so green pixels don’t need to be as physically large to appear just as bright to our eyes). However, it means that the ‘pixel’ in a standard AMOLED display consists of 8 colours: RGBG on top of BGRG. Some people claim this leads to less sharp images compared to the standard RGB displays of LCD displays (see below) that are sometimes referred to as real-stripe displays.

LCD-rgb-subpixel-matrix

Some of the AMOLED displays have an RGBW layout, which adds a white subpixel next to the standard RGB subpixels. This allows the display to have an edge in brightness due to a dedicated white subpixel. With that advantage the backlight doesn’t need to be as bright, which saves battery since the backlight is a major user of battery in a mobile device. There is also Samsung’s latest Super AMOLED display technology that has a new subpixel arrangement called the Diamond Pixel. The first phone to use this pentile type was the Galaxy S4. There there are twice as many green subpixels as there are blue and red ones, and the green subpixels are oval and small while the red and blue ones are diamond-shaped and larger (the blue subpixel is slightly larger than the red one).

Displays are much more complicated and varied than you might think. One consequence is that it is not so easy to compare the resolution of different displays technologies beacause they vary in what they call a pixel.

do glasses for colour blindness work?

Multi_Colour_Rainbow_Clear_Lens_Wayfarer_Sunglasses_hi_res

For a while there have been coloured lenses on the market that claim that to make colour blindness better. I have my doubts about this. I have tested some of these glasses in my own research and found that they do not work. So I was interested to hear of work by Rebecca Mastey and Richard Schultz at University of Wisconsin-Green Bay that also finds that the products do not work. The researchers tested products from with 27 men with genetically confirmed red-green colour blindness.

The O2 Amp glasses showed some improvement with deuteranomalous observers and deuteranopes, no improvement was found for protonopes whilst the EnChroma glasses had no significant impact on the red-green colour discrimination of any of the participants. The work was presented at the annual meeting of the Association for Research in Vision and Ophthalmology in Seattle.

“The data confirm that these glasses don’t work,” says Dr. Carroll. “In fact, they make some aspects of your vision worse.”

Out of interest, there is also this personal story about a guy with anomalous trichromacy who tested some glasses from EnChroma and fond they made no difference at all.