Monday, November 21, 2005

RGB power... are you asking for a challenge?!

At risk of contracting addendophobia, I'm doing a follow up to my severely lengthy and ranty post on Thursday about colour spaces.

To say...


Are you asking for a challenge?!
Image hosted by Photobucket.com
(click to enlarge)

Thanks Andrew!

Thursday, November 17, 2005

Matt Loses It: Colour Spaces

The people who know me know that for some reason, there's one thing in the whole world which gets me more upset with the general ignorance of people than anything else. I think the reason is that I'm so gosh darn positive I'm right about it yet keep being told by practically everyone else that I'm not.

Particularly, I get a surge of irritation every few months or so when The Age quiz asks a question like this:
"The primary colours are red, yellow and what?"
The answer of course being "red, green and blue you dumb piece of unintelligible excuse for information!"

Today the question was this:
"In pigments, the secondary colours are purple, orange and what?"
The answer was green. Even more people think it's correct. I'm not going to comment on that yet because I can't explain just how wrong it is until later.

Yet every time it does, for some reason, everyone else thinks The Age is right. Just goes to show you can't believe everything you read in the newspaper. I haven't blogged about it before but... I've had enough. Here's what I'm going to do.

I'm going to lay it all out, right here, all the facts, all the theories and all the myths, and I'm going to have links to Wikipedia everywhere. There are a huge number of pages on Wikipedia relating to colour theory, and by some strange act of the Maker, they all agree with me. I'll also find some other non-wiki sources for those of you who don't have faith in the world's collective knowledge.

What you learned in primary school

Everyone knows the primary colours are Red, Blue and Yellow, right? As Mish keeps pointing out, that is what we learned in kindergarten. There are several reasons this "fact" was presented to us:
  • Red-Yellow-Blue (or RYB) is the classic set of colours, previously believed to be "primary" since they mix well.

  • At the age of 5, you don't know big words like "cyan" or "magenta", so it's just easier this way.

  • Red is pretty close to magenta. Blue is pretty close to cyan. For primary school purposes, it is most certainly "close enough". But if you're trying to win an argument, it most certainly is not!

And artists may still use RYB for painting (that is: pigment, or subtractive colour, as we'll see later). They are free to do this - it's art. You can do whatever you want in art. What I'm talking about is science. Actual physical what do you see and why do you see it science. And please, nobody say "Brainiac", I'm too upset as it is.

Wikipedia: RYB color model:

RYB is a historical set of subtractive primary colors. Nowadays, we know that this set is incorrect, but it continues to be in common use in art. In it, green is a mixture of blue and yellow, yellow is the complement of violet and orange is the complement of blue. Today, scientists know the true set is CMY, which uses cyan as opposed to blue and magenta as opposed to red.
And guess what... the secondary colours of the RYB colour model (the colours you get if you mix combinations of red, yellow and blue) are... you guessed it: orange, purple, and green. So The Age quiz today was in fact giving secondaries in terms of RYB.

So RYB: Useful? Yes. Correct? No.

And just why isn't it correct? Well they are three colours which can be mixed. But they aren't primaries.

What are primary colours?

Wikipedia: Primary colors
Also have a read of this.
Firstly, there seems to be some debate over whether there really is such a thing as primary colours or not. (If there isn't, then I win, The Age is wrong... but here's my argument). A primary set is a set of three colours which can be added or subtracted in any proportion to each other to produce any colour possible. I don't know how, but it's pretty much been determined that red, blue and yellow DO NOT form a vector basis in a colour space. This means they cannot form all colours by mixing. Which colours do?

The argument against having primaries at all is that there can be no set of three colours that form a vector basis (sorry, that doesn't include RYB) which is "better" than any other set. Well, colour is in the eye of the beholder, and most of us are humans. So let's take a look at the human eye.

As we see here, the human eye is comprised of three types of cones: red, green and blue. As summarised by Wiki's Primary colors page:

Primary colors are not a physical but rather a biological concept, based on the physiological response of the human eye to light. The human eye contains receptors called cones which normally respond to red, green, and blue light. Humans and other species with three such types of color receptors are known as trichromats. Although the peak responsivities of the cones do not occur exactly at the red, green and blue frequencies, those three colors are chosen as primary because they provide a wide gamut, making it possible to almost independently stimulate the three color receptors. To generate optimal color ranges for species other than humans, other additive primary colors would have to be used.
OK so from this point on, we're talking about humans only. That bother anyone?

THUS for human beings, the primary colours are our old friends: Red, Green and Blue.

Red, Green and Blue

These colours aren't dealing with paint though, as we originally were. Since we're talking about the human eye, we're talking about light. Well... shouldn't we be? After all, colour is made of light. Paint is just pigment, it's something that creates colour indirectly.

Wikipedia: RGB color model.
As many of us are computer scientists, we will be immediately familiar with the RGB colour model. All images on the computer are saved in a format which records each pixel as a mixing of red, green and blue. This isn't just a file format though - the data is sent to the video card, which sends it to the screen, STILL IN RGB FORMAT. And the screen doesn't mix the colours before displaying them to you. What it does is display THREE SEPARATE dots, one red, one green, and one blue. The colour is mixed by your mind!

And that's exactly why we use RGB for computer and television screens - because those three colours are the best primaries for your eye/mind to interpret.

What are secondary colours?

This one's easy. From wiki:
(Wikipedia: Secondary color)
"A secondary color is a color made by mixing two primary colors in a given color space."

It's as simple as that. Here's what you get when you mix the primary colours of light for human eyes, RGB:
red + green = yellow
red + blue = magenta
green + blue = cyan

So Cyan, Magenta and Yellow (in their conventional order) are the secondary colours of light. There isn't much to dispute here (provided you agree RGB are the primaries) - if you don't believe me just mix them yourself in paint.

What are primary pigments?

OK so now we return to pigments (almost there people). Pigments are not "colours" as such - they are physical "colours" of things in the world. Light reflects off them, and they subtract certain wavelengths from the light and the colour you see is a result of that. We all know this fact.

Note the key word here: subtract. Pigments subtract colour instead of adding to it like a light bulb might. So, mixing pigments is different. When you mix two pigments, their subtractive power increases and they let less light escape. So when you mix all three primary pigments, you get black. As opposed to light which, when mixed, forms white.

It isn't hard to imagine that if the primary colours of light (which are also known as additive primaries) are RGB, then the primary pigments (note: I did not say "primary colours of pigment", which is wrong) are Cyan, Magenta and Yellow. And you'd be right (if you imagined that).

These are the colours found in your printer - the pigment equivalent of the screen in our computer age. When you print, you have four cartridges - cyan, magenta, yellow and black (the black is there because it's not nice to mix cyan, magenta and yellow all up together). These same four colours have been used for decades on dedicated printing plates to print coloured books and magazines.

These are known as the Subtractive primaries. Being opposite to the additives, what do you think happens when you MIX them?

cyan + magenta = blue
cyan + yellow = green
magenta + yellow = red

Makes logical sense doesn't it? Everything fits nicely.

And what do we call it when you mix primaries? Secondaries! So the seconary pigments are Red, Green and Blue.

Summary

Additive (Light) Primaries: Red, Green, Blue
Additive (Light) Secondaries: Cyan, Magenta, Yellow
Subtractive (Pigment) Primaries: Cyan, Magenta, Yellow
Subtractive (Pigment) Secondaries: Red, Green, Blue
Historical (Art) Primaries: Red, Blue, Yellow
Historical (Art) Secondaries: Orange, Green, Purple

And hopefully, that clears everything up. Please ask if you need clarification, but don't tell me that red, blue and yellow are primaries, or that orange, purple and green are secondaries.
It's a myth taught to you out of convenience and tradition which has no basis in science.
*phew* now if you'll excuse me, I have an exam to study for...

Tuesday, November 08, 2005

Thou Shalt Not Defecate The Internet

Found an.... interesting site here. OK Tim found it, but I blogged it!
Net Authority seems to be a fairly radical kind/caring "let's clean up the Internet, so as it conforms to God's will" site.

As with a lot of these things (let's take "Intelligent Design" for an example), the principles are... well, fairly sound (if a bit radical), but in my opinion I wish they would stop bringing GOD into things.
If you have ever read an acceptable use policy before, you are probably aware that they are long, drawn-out documents often written in highly obfuscated language intended more for confusing the reader than actually providing useful information. Since this policy applies to the entire Internet, we felt that it should be spelled out as simply and as universally understandable as possible.
Which, of course, is why the clauses begin with "Thou shalt not"......

Here's the policy: The Internet: Acceptable Use Policy.
Note: You must accept this policy to begin using The Internet. Failure to comply may result in a temporary or permanent ban!!!
(I said that, it's not a quote)

We're not going to wrap it up in legal mumbo-jumbo, oh no. Oh, except for this bit here:
Posting information or content in any form on the Internet constitutes acceptance of and agreement to the Net Authority Internet Acceptable Use Policy.

So there you go. This very minute, by me writing this, I am accepting to this policy. Umm... I really hope you aren't thinking about sexual things due to anything I've written, or I could go to jail!!!
4. Thou shalt not post materials of an offensive political nature.
Damn you Bush!

OK I think I've had my fun. We think this site may be a joke, but it's hard to tell. There are definitely people out there who think like this. If you are one of them, please feel free to leave a comment ;)

And now, if you'll excuse me, I believe I'm going to hell. Goodbye.