The use of colors, color depth, resolution and so on can be quite hard to
grasp. In this article I will try to explain the absolute basics of these
terms, as well as show you a few, easy examples. We'll start of by
explaining each term:
Pixel - Short for "picture element". It is the smallest element on
your raster display.
Color depth - This is the number of bits that represent each picture
element (pixel) on the screen. You may have heard of bpp - bits per pixel.
The normal modes of today is 16, 24 or 32bit. On some consoles they still
use 8bit though. 8bit enables you to have 256 colors on screen at once
(because 2^8 = 256, or rather 255 in programming where 0 is an adressable
value). 16bit give you 16,386 colors (2^16), while 24 and 32bit are called
"True Color".
Resolution - The number of picture elements on screen at once. Normal
resolutions and their size in memory are as follows:
Resolution |
Bits per Pixel |
Memory Usage (min-max) |
640x480 |
8, 16, 24, 32 |
307KB-1.22MB |
800x600 |
8, 16, 24, 32 |
480KB-1.92MB |
1024x768 |
8, 16, 24, 32 |
768KB-3.14MB |
1280x1024 |
8, 16, 24, 32 |
1.31MB-5.24MB |
1600x1200 |
8, 16, 24, 32 |
1.92MB-7.68MB |
Video RAM(VRAM) - The amount of memory onboard on a video card
representing the video image(s) on the screen or in texture memory.
Refresh rate - The number of times per second the video image is
refreshed. It is measured in hertz (Hz) or fps (frames per second).
Now that you know a bit about the different terms, lets have a look at the
different encodings there are. There are two ways to display color on a
video display; directly or indirectly. As for this article, it will only
cover some the 16bit encodings, which is a direct color mode.
RGB(5.5.5)+1
In this color mode, 5 bits are spread to each color (RGB), then the last bit
is added to a selected color. There are three variations here; RGB(6.5.5),
RGB(5.6.5) and RGB(5.5.6). The RGB(5.6.5) is the most common one.
RGB(1.5.5.5)
Here we have 5 bits on each color, and 1 bit on the Alpha layer. Alpha layer
controls the transparency.
Here is a more visual presentation of two different color modes:
All this information is absolutely crucial when coding a graphics engine.
Although Windows have made it transparent (hid it under lots of functions),
you have to know this when coding for consoles.
|