Deconstructing 16Bit Colour
Hello all,
I would like to ask how on earth to figure out, or know, what the colour values in 16bit are. Let me clarify
In the 8 bit world, I knew that I had 256 colours, and a palette, I could specify that palette to whatever I liked, now say I had 64 white, 64 red, 64 green, 64 blue. Thats 256 colours yeah ? And I know what colours are what. Cause I set them up.
Now, in 16bit, there is no palette, so can I assume that they are actually stored logically, cause surely the colours cannot be random, since then, how would I know what colour is what ? right ?
My main point is how do I specify a brilliant white, or shade of, when I dont know (or can figure out) what colour those shades of white I need are ?
Now, I understand that there are two 16bit systems that I can use, 5-5-5 and 5-6-5. Now, that would mean that I can use either of those, the 6 specifies more green values right?
So, could I work out what brilliant white is this way.
5-6-5 is the number of bits for the red, green and blue, so basically, there are 32 shades of red, 64 shades of green and 32 shades of blue, yeah ? so would brilliant white be RGB = 32,64,32 ?
well, I think I made my point and posed my question in a way people can debate upon. Thanks
kosh
if understanding it made and born with time, then time, is understandings greatest enemy.....
You don''t get to chose which 16bit format to use. The video card does. 
Let''s talk only 565 for now.
The first five bits represent red, the next six green, the last five blue.
So it looks like:
RRRRRGGG GGGBBBBB
So 32 shades of red, 64 shades of green, 32 shades of blue.
The most brilliant red is five R bits set or 31.
The most brilliant green is six G bits set or 63.
The most brilliant blue is five B bits set or 31.
In order to combine your red, green and blue values you use bit shifts and adds.
color = (red << 11) + (green << 5) + blue;
assuming of course that red is from 0 to 31, green from 0 to 63 and blue from 0 to 31.
So the most brillaint white is 11111111 11111111 = 0xffff.
Pure red would be 11111000 00000000 = 0xf800.
And so on.

Let''s talk only 565 for now.
The first five bits represent red, the next six green, the last five blue.
So it looks like:
RRRRRGGG GGGBBBBB
So 32 shades of red, 64 shades of green, 32 shades of blue.
The most brilliant red is five R bits set or 31.
The most brilliant green is six G bits set or 63.
The most brilliant blue is five B bits set or 31.
In order to combine your red, green and blue values you use bit shifts and adds.
color = (red << 11) + (green << 5) + blue;
assuming of course that red is from 0 to 31, green from 0 to 63 and blue from 0 to 31.
So the most brillaint white is 11111111 11111111 = 0xffff.
Pure red would be 11111000 00000000 = 0xf800.
And so on.
i think ill stick with 8-bit for a while
. base-2 is a little beyond me right now, and this bitshift business, its nasiating. i congradulate anyone who is actually fluent with this system as they are with base-10.
and what were manufactuers thinking when they made 5-5-5 AND 5-6-5? trying to confuse us ;(?
listen SiCrance, you seem to be the God of Bits. i need a really quick crash course in bits and bytes and etc., and why this all works. i figured out how color = (red << 11) + (green << 5) + blue works (thanks to my other post on << and >>), but i need more explanations. and then what happens in 32-bit colors?
(why do i make myself dizzy?)

and what were manufactuers thinking when they made 5-5-5 AND 5-6-5? trying to confuse us ;(?
listen SiCrance, you seem to be the God of Bits. i need a really quick crash course in bits and bytes and etc., and why this all works. i figured out how color = (red << 11) + (green << 5) + blue works (thanks to my other post on << and >>), but i need more explanations. and then what happens in 32-bit colors?
(why do i make myself dizzy?)

Well, with 16 bit color, you can''t have a palette. There just isn''t enough video memory for it. Unless you want to spend 2 MB video memory on just your palette. And can you imagine how long it would take to initialize that kind of palette? ::shudder::
So instead the 565 and 555 formats were developed to encode the actual color values in the color number. 565 maximizes the number of bits of useful information, 555 gives you balanced color information.
32-bit color is similar except there''s usally 8 bits of color for each RGB, as well as 8 bits of alpha. RGBA or ARGB. (Ok, there are also some funky 32-bit color formats, but I pretend that they don''t exist. That''s called blissfuly ignorance.
)
Zipster, what else do you need to know about bit stuff? There''s not much more to it for color information.
So instead the 565 and 555 formats were developed to encode the actual color values in the color number. 565 maximizes the number of bits of useful information, 555 gives you balanced color information.
32-bit color is similar except there''s usally 8 bits of color for each RGB, as well as 8 bits of alpha. RGBA or ARGB. (Ok, there are also some funky 32-bit color formats, but I pretend that they don''t exist. That''s called blissfuly ignorance.

Zipster, what else do you need to know about bit stuff? There''s not much more to it for color information.
hello all,
right, I get it now, I think I was on the right track, ok, now I know I am
Sicrane, once again, you prove to be the proverbian fountain of knowledge
byebye all
right, I get it now, I think I was on the right track, ok, now I know I am

Sicrane, once again, you prove to be the proverbian fountain of knowledge

byebye all
if understanding it made and born with time, then time, is understandings greatest enemy.....
the wierdest thing happened; after making my previous post on 16-bit colors, i went downstairs, and all of this bit stuff just hit me! i just understood. it was like...i donno, but it was wierd. i suddenly felt like an expert, and that this stuff is so easy!!! ill prove it to ya:
i realized that 8-bit is simply a mini-version of 24-bit, with only 256 colors being visible at one time , since once you change a color register, they automatically change on screen. it uses a CLUT and 24-bit style becuase for only 8 bits per pixel, 2.2.4 or 3.3.2 don't seem very exciting. 24-bit is 8.8.8, alowing up to 16.7 million colors.
32-bit is 8.8.8.8 (first byte for alpha (transparency)), with up to 4.2 billion :0 colors
16-bit: ranging from 32,768 to 65,536 colors
5.6.5 , no transparency, 65,536 colors
1.5.5.5, less colors, but transparency option, 32,768 colors
2-bit: 4 colors
4-bit 16 colors
as you can see, it really did just hit me!!

consider me an expert now









Edited by - Zipster on 3/19/00 12:24:55 AM
Edited by - Zipster on 3/19/00 1:42:24 AM
Edited by - Zipster on 3/19/00 1:44:03 AM
i realized that 8-bit is simply a mini-version of 24-bit, with only 256 colors being visible at one time , since once you change a color register, they automatically change on screen. it uses a CLUT and 24-bit style becuase for only 8 bits per pixel, 2.2.4 or 3.3.2 don't seem very exciting. 24-bit is 8.8.8, alowing up to 16.7 million colors.
32-bit is 8.8.8.8 (first byte for alpha (transparency)), with up to 4.2 billion :0 colors
16-bit: ranging from 32,768 to 65,536 colors
5.6.5 , no transparency, 65,536 colors
1.5.5.5, less colors, but transparency option, 32,768 colors
2-bit: 4 colors
4-bit 16 colors
as you can see, it really did just hit me!!


consider me an expert now










Edited by - Zipster on 3/19/00 12:24:55 AM
Edited by - Zipster on 3/19/00 1:42:24 AM
Edited by - Zipster on 3/19/00 1:44:03 AM
Just wondering, does anybody know the popularity of different 16 bit implementations. ie. percentage of video cards that use 5-6-5 ?
well..i cant give a percentage, but most video cards do use 5-6-5 since there are more color arrangments. 1.5.5.5 isnt as popular since the transparency bit can be simulated just by altering the RGB bits.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement