gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > About 256 color palettes and 16 color palettes

#17329 - hakanyuksel - Sat Mar 06, 2004 2:14 pm

Why do you use 16 color palettes instead of 256 color. What are the advantages and disadvantages of 16 and 256 colorpalettes?
_________________
--------------------
Hakan Yuksel
3TE GAmes
www.3tegames.com

#17332 - poslundc - Sat Mar 06, 2004 2:32 pm

16-colour sprites and background tiles take up half the space of 256-colour sprites and tiles, because you only need 4 bits to represent numbers up to 16 (instead of 8 bits to represent numbers up to 256).

There may be other reasons, but I've gotta head out...

Dan.

#17335 - jma - Sat Mar 06, 2004 4:33 pm

16-color palettes allow you to quickly and dynamically change the colors of different tiles and sprites.

For example, lets say you are making a game that requires day and night tilesets. No need to create two different ones -- just make one, and switch which palette(s) is/are being used on those tiles based on the time of day.

Likewise, lets say you are making a game with tanks. There are your tanks (red) and the GBA's tanks (blue). Why create two different sprite images (one red and one blue). Instead, only make 1 graphics shared by both -- just a different palette is applied.

Jeff
_________________
massung@gmail.com
http://www.retrobyte.org

#17344 - hakanyuksel - Sat Mar 06, 2004 5:53 pm

I see. You group the sprites in a different way by using 16 color paletes. So you dont need to think about all the 256 colors. As a result is is faster to change 16 color palettes.
_________________
--------------------
Hakan Yuksel
3TE GAmes
www.3tegames.com

#17357 - jma - Sat Mar 06, 2004 9:17 pm

Yes, but there is a lot more that you can do, too.

For example: water tiles can use a single palette that can be rotated (palette animation) which has the effect of waves, without changing any graphics or pixels.

Jeff
_________________
massung@gmail.com
http://www.retrobyte.org

#17360 - Miked0801 - Sat Mar 06, 2004 9:36 pm

Plus, 16-palette graphics take half as much ROM space, take half as long to load into RAM, and take half as much VRAM. This platform likes 4-bit.