What is Color?
Color is a sensation that certain wavelengths of light cause in our brain.
Luckily we are all wired alike and can discuss and appreciate a certain color in the same way. Well, almost.
The difference between Bits and Bytes
One Byte (B) = 8 bits (b)
Since the possible combination of wavelengths is infinite, there are infinite colors in nature. But it’s said that the human brain can see 10 million colors or so.
That means somebody making a dictionary of colors will need 10 million names. Here’s one challenge – how many letters should each name be?
If I was forced to make names with just two characters, I can only make 2 names. Three characters will give me 8 names; four will give me 16 names, and so on. The formula for how many names I’ll get with n characters (bits) is:
How many do I need for 10 million colors? Bring out those calculators, and hope you get a number between 23 and 24. We can’t have fractions so we’ll have to go with 24.
That means each word will have to be 24 characters (bits) long, and the dictionary dude will get one unique name per color.
Computers work in 1s and 0s, and a word is made up of 1s and 0s. A bit is either a 1 or a 0. It is represented by the letter b (Always in lower case!).
Eight bits is a Byte. A byte is also represented by the letter B (Always in upper case!).
Some people love to mix and match their bs and Bs. Please don’t.
What is a Color Model?
Light is made up of many wavelengths. Color is just a sensation inside us. How do we talk about color without resorting to wavelengths and other super-heavy geeky stuff?
We do it by using something called a color model. A color model is simply (it’s anything but simple!) a way wavelengths of light are ‘mapped’ to certain colors, with a mathematical and scientific basis.
It’s sort of like using numbers to represent alphabets in ciphers. It’s like calling a “wavelengthosaurusicolor” a 254. Which is simpler?
That means there can be as many color models as there are colors – infinite. So we can’t let everybody randomly choose their own color models. It’d be as if everyone were speaking different languages.
To keep things under check, it was decided that colors will be split up into three groups, or primaries – Red, Green and Blue. This is done because our eye works similarly. It seems that every color under the sun can be mathematically reproduced by combining the values of these three primaries.
E.g. If I have 17 Red spoons of coffee, 24 Green spoons of sugar and 2 spoons of milk, I might get 1 cup of coffee. See how the scientists and mathematicians managed to find a way to change all that scary wavelength stuff into three groups of numbers?
There are many color models. Two of the most common are RGB and CMYK. Since CMYK is mainly used for printing, let’s only discuss RGB.
The RGB Color Model
The most widely known (and abused) color model is the RGB model.
RGB stands for Red, Green and Blue.
It is an additive model, which means that various values of Red, Green and Blue are added together to form the other colors.
The big advantage of this model is its simplicity.
This simplicity is also its greatest weakness. The problem with RGB models is, different devices interpret the values of R, G and B differently. E.g., 255, 0, 0 (R, G, B) is pure red in 8-bit mode theoretically but different display devices might show two different shades of red using the same file.
How is that possible? Shouldn’t two devices following the same model show the same color? Our eyes follow the RGB model, yet can we say that two people see Red the same way? So why should two dumb display devices?
So, it is obvious that a color model also needs to be mapped to different display devices, and this brings in a whole new level of weird. Think of it as grammar to language. The color model is a language, but that’s not enough. Language needs grammar, spelling, punctuation, etc. to be understood. The result is what is called a Color Space.
In the RGB model, the colors Red, Green and Blue are called primaries, and each is assigned a channel.
A channel is just like a seat in a bus that needs passengers. The passenger is the value of the primary.
So, if Red is 255, 0, 0, say, then the value of the primary R is 255. This data is written down in its own space on disk. What about the values of G and B? They are zero in this case, but they still have reserved spots in a file system – you never know when someone might want to tweak the file and change the color. This reserved space is called a channel.
Since the RGB model is based on three primaries – R, G and B, it is said to have three color channels.
An RGB model always has 3 color channels.
How many channels does a black and white image have? If you said 1 you are both right and wrong. It’s a trick question. The answer depends on your color model.
If you’re using the CMYK model, you could have 4 channels.
A black and white image in the RGB model is made by adding Red, Green and Blue, so it has three channels.
However, you could use a monochromatic color model, which only shows white, black and shades of grey. This model will need only one channel.
What is Color Bit Depth?
As we have seen, the size of the word in bits determines how many combinations we get. If our eyes can see 10 million colors, or 24 bits’ worth, then what happens when we split this into three primaries, RGB?
Each primary, called a channel, will need 8 bits (8 x 3 = 24). Therefore, the Red channel, Blue channel and Green channel will each need a word size of 8-bits.
This word size per channel is called the Color Bit Depth.
Each channel will start at 0 (no color) to a maximum value determined by the color bit depth (full color, Red, Green or Blue). In between these extremes, we have shades of one color. The red channel will start at 0 and go to full red, the blue channel will have values from 0 to full blue, and so with the green channel. These values are called tones.
In an 8-bit image, each channel can hold 28 or 256 tones.
An 8-bit image can have 28 = 256 tones
A 16-bit image can have 216 = 65,536 tones
A 24-bit image can have about 16.8 million tones
A 32-bit image can have about 4.3 billion tones
Most consumer video is 8-bit. Why, you ask? Because it can see all the colors the human eye can possibly see, theoretically.
What engineers found long ago is that most humans don’t know or can’t name more colors than VIBGYOR. Artists and experts might be able to remember a few thousands but they are in the minority. 256 tones per channel are supposedly “good enough” for most people.
You don’t think so? How many complained about it? If they did, they showed it poorly, judging by the spread of television like wildfire. A similar thing is happening today with internet video, but that’s another story.
Just because 8 bits can show all the colors the human eye can see does not mean it can do so practically. What the hell do I mean by that? To understand this, you need to understand the Color Gamut.