Refreshing the combination of red, green, and blue lights on your screen
Did you know that the act of rendering an image to display on your computer screen is called "painting"? It's true! When your desktop starts up, it paints the background image, then all of the icons get painted, then any windows or applications that you have open, then the task bar with the start menu (assuming you're using Windows), minimized icons, and time, and finally the mouse pointer.
The color on your screen is stored in 32 bits (on modern machinery. Other examples include storing color in 32 bits but only using 24 of those bits, storing color in 16 bits, having a palette (more painting terminology) of 256 colors using 16 or 24 bit values, and actually representing those colors using 8 bit indexes that refer to the values in the palette, or just using 8 bit color which allows for 16 colors.)
Does anyone know what color you get when you mix yellow and blue together? You get green! This is a very strange property of pigments. You can mix yellow and blue pigments together to get green. However, pigments and light are two different things. Light is composed of three primary colors: red, green, and blue. If you want green, you just use green light. If you want yellow, you have to mix red and green together. Computers use this aspect to create the colors you see. Your monitor uses these three main components of light with different strengths (up to 256 different values for each of the three colors) to paint the screen.
I've been doing some graphics programming and this is what's been going through my head a little bit lately.
My life is a dark and lonely rainbow surrounded by friends.
The color on your screen is stored in 32 bits (on modern machinery. Other examples include storing color in 32 bits but only using 24 of those bits, storing color in 16 bits, having a palette (more painting terminology) of 256 colors using 16 or 24 bit values, and actually representing those colors using 8 bit indexes that refer to the values in the palette, or just using 8 bit color which allows for 16 colors.)
Does anyone know what color you get when you mix yellow and blue together? You get green! This is a very strange property of pigments. You can mix yellow and blue pigments together to get green. However, pigments and light are two different things. Light is composed of three primary colors: red, green, and blue. If you want green, you just use green light. If you want yellow, you have to mix red and green together. Computers use this aspect to create the colors you see. Your monitor uses these three main components of light with different strengths (up to 256 different values for each of the three colors) to paint the screen.
I've been doing some graphics programming and this is what's been going through my head a little bit lately.
My life is a dark and lonely rainbow surrounded by friends.

7 Comments:
I like the way you compressing these educational nuggets into byte sized morsels.
HA HA HA...that's a computer joke!
Joe: Ha!
I'm actually at a loss for what to write. I guess I'm suffering from writer's block and, when that happens, you just write what you know, you know?
Actually (and I may have mentioned this before) I really enjoy these.
Even if my programming knowledge is hopelessly antiquated. lol
Joe: You have mentioned this before. I'm just surprised (still) to find someone else that likes this crap! :D
So now I know how those colours are applied.
I presume the sam theory can be magnified for a vast palette of colours.
Ultra: Yes, it could, but it's better not to use the palette model for computers that can display 16 bit color or greater. For the palette, it was decided to use 256 colors because of the space saving nature. Working backwards through the technology: 24 bit (3 byte) values split the red, green, and blue values into 8 bits each. 16 bit (2 byte) values split the red, green, and blue values into 5 bits each, with 1 bit left unused. 8 bit (1 byte) values use 2 bits for each color. Using 2 bits just for red means that you get a dark red, a light red, or no red at all. Using 5 bits gives you up to 32 different values per color which means you get up to 32,767 different possible colors. Using 8 bits gives you up to 256 different values per color which means you get up to 16,777,215 different possible colors.
We could increase the palette index to 2 bytes to allow for more than 256 colors, but it makes more sense to store the color information as opposed to the index (i.e. do away with a palette to refer to colors and just use the colors themselves.) When color values get up to 24 bits, you start to see what's called color aliasing. At this point, you don't have to worry about including colors that aren't included in your 16,777,215 choices because the average human eye is incapable of discerning between two very close colors at that level of granularity.
That learned me!
Woo hoo!
Post a Comment
<< Home