Advertisement

24 bit vs 16 bit color...

Started by March 02, 2000 04:41 AM
9 comments, last by crouilla 24 years, 6 months ago
Hi, all, Quick question -- how do you guys feel about 24-bit vs 16-bit color? I''m tempted to use 24-bit color graphics for my 2d isometric RPG, but don''t see any appreciable difference over 16-bit when I render my images in 3DS. Do you personally think it would be worth the extra memory usage (or did I just answer my own question)? -Chris ---<<>>--- Chris Rouillard Software Engineer crouilla@hotmail.com
---<<>>--- Chris Rouillard Software Engineercrouilla@hotmail.com
It is very hard to see the difference between 16 and 24 bit graphics, if it simple. If you use many layers that are blended into each other, e.g. smoke, then you might want to use 24 bit as the dithering in 16 bit makes this very ugly.

For a isometric engine you will most likely not have several blended layers, as such you will do just fine with 16 bit.

Advertisement
just a little note....
16bit mode is a pain in the ass from my experance. do to the way it is implemented... color are represented in an RGB format... thats 3 numbers... the problem is that 16 dosen''t devide by 3 evenly... theres an extra bit. heres the problem with that... on some cards 16 mode is realy 15 bit mode... they through out the extra bit on the end... on other cards they give the extra bit to on of the colors(green I think) this isn''t such a problem expet for when it comes to trancparency... the value RGB(34,56,34) on one card would be something like say RGB(34,55,35) on the next(sorry I didn''t go through the troble of figuring out what it would be realy, but you get the point).

So in my opinion the large memory usage and slightly lower rendering is aceptable considering the headaches....

Great Milenko

Words Of Wisdom:
"Never Stick A Pretzel In Your Butt It Might Break Off In There."


http://www.crosswinds.net/~milenko
http://www.crosswinds.net/~pirotech

The Great Milenko"Don't stick a pretzel up your ass, it might get stuck in there.""Computer Programming is findding the right wrench to hammer in the correct screw."
Thanks, guys,

I plan to have a lot of surfaces, so I''ll probably use 16-bit mode. It''s a little more painful (determining between 555 and 565 mode), but I''m benchmarking for lower-end systems, many of which won''t have more than a 2-meg card (including the laptop I''m developing on)

-Chris

---<<>>---
Chris Rouillard
Software Engineer
crouilla@hotmail.com
---<<>>--- Chris Rouillard Software Engineercrouilla@hotmail.com

Don´t use 24 bit..

Many gfx-cards do not support this resolution..
I know my Asus TNT-1 does not.

use 16 or 32 bit..
-------------Ban KalvinB !
USe 16 bit. Finding the difference between 555 and 565 isn''t hard, there is code on this very site to do it. 24 bit wastes way too much memory with an unnoticable difference in color quality.
Advertisement
not to mention that without hardware acceleration (which looks like thats what you''re aiming for) 16bit is at the upper limit of reasonable performance. software 32bit graphics means you throw framerate right out the window.
sure, if you have a p3-700 with a super duper graphics card and loads of RAM, 32bit will seem like the perfect choice (which it would be) but you say you''re targetting lower-end systems, anythig above 16bit is too much of a sacrifice in terms of performance.

i would even *consider* 8bit. if done right it looks very decent, and is very fast.
i personally thinks 24 bit is a very lame colordepth.
3-bytes is an odd number... not all cards support 24bpp modes...

16-bit is much cooler - ALL cards support 16bpp, and it is very easy to implement... all the stuff about color-dithering is easily done by some cool macro, and 2 bytes is quite less than 3 bytes.
565 ot 555 ? hmm... if a gfx card uses 555, then DirectX emulates 565.. (ALWAYS 565 BGR)

Another thing: why not support BOTH 16-bit and 32-bit? Store all textures and tiles in 24-bit color, and convert them to 16-bit or 32-bit at startup?

... hmmm .. my english sucks ...

bye for now


Rasmus Neckelmann
-- Rasmus Neckelmann
How to use 16 - Bit with RGB:

Well, if you gonna use a RGB - value you first should create a three - dimensional array. The first dimension is for R, the second for G and the last for B. Now at the beginning of the program lock a surface and paint all 65535 pixels. You should do like this:

COLORREF Clr;
HDC hDC;

Surface -> GetDC( &hDC );

for( int i = 0; i < 65535; i++ )
{
//painting a pixel
Surface[0] = i;

//now get the color standing for the value you used( i )
Clr = GetPixel( hDC,1,1 );

//Save it in the right element of the three - dimensional //array
Array[GetRValue(Clr)][GetGValue(Clr)][GetBValue(Clr)] = i;
}

Surface -> ReleaseDC( hDC );

Afterwards if you want to use a color you''ve to use the array like this:

perhaps the RGB - value ( 12,12,12 ):

Surface[whatever] = Array[12][12][12];

I never tried it so you''ve to....

If it works you won''t have problems with different graphic cards in 16-Bit any longer.

my Mail: Centum@gmx.net
Hit me or ask me if it doesn''t work....
Thanks all,

I already have the logic down of using 16-bit with DirectX, so it isn''t an issue -- I was just seeing what the general concensus was on which was better to use. It sounds like 16-bit is the way to go.

-Chris
---<<>>--- Chris Rouillard Software Engineercrouilla@hotmail.com

This topic is closed to new replies.

Advertisement