Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Alynn on Tue 25/11/2003 15:13:48

Title: Hi-Color Pallete
Post by: Alynn on Tue 25/11/2003 15:13:48
Maybe I'm totally messed up but....

I have a room, on the color count for the room it shows 253 colors, however when I import the background into AGS it says I have too many colors 253 colors shouldnt be too much in a high color game... For an experiment I started a new game with 8 bit color and imported the room (default 8 bit pallate with no changes) and I recieved the same error, and the room imported and looked the exact same as in high color...

Exact pallate turns all my colors all funky in both modes...

Also, when I was looking through the color numbers in the editor I noticed that by adjusting the blue you get the color numbers 0-31, however when trying to find the next lowest number, it is 64... what happened to colors 32-63, I also noticed the sliders only go up to 31 while in 8-bit the sliders go to 63...

Anyway... just wanting an explination, reason, workaround for my background problem, and what is the deal with the pallate (IE do I have to know all the colors that AGS uses in high color and match them or the background wont import properly or what)
Title: Re:Hi-Color Pallete
Post by: on Tue 25/11/2003 16:23:30

Hi, Alynn. I didn't fully understand what your problem with backgrounds is, but I can help you understand some other aspects regarding 8-bit (palette) and 16-bit (hi-colour).

In 8-bit mode, each pixel is described by a single byte (that is, 8 bits). If those 8 bits had to code the quantities of red green and blue of the pixel, the quality would be very low, for there would be just 2 or 3 bits per component (r,g,b). That means the range for each component would be 0-4 or 0-8.
Instead, what is actually done is this: the 8 bits represent not (r,g,b) quantities, but a position (0-255) inside a color table (the palette). In this palette, each position is coded with 6 bits per component (creating a range of 0-63). That's why you have that range while in b-bit mode.

Now, 16 bit mode uses no palette. In this mode, those 16 bits (two bytes) DO code the (r,g,b) quantities of each pixel. So there are 5 bits per component (actually, green takes the extra bit, to sum 16) and that makes a range of 0-31.

So, 8-bit mode is more precise (in a color-by-color sense) than 16-bit, but has a lower limit on the amount of colours that can be displayed at once (256 in 8-bit, 65536 in 16 bit).

In 16-bit mode, the resulting colour number is given by:

colour = 2048 * Red + 64 * Green + Blue

And that is why there are gaps in colour numbers.


I hope all this helps you, although maybe I didn't make myself very clear.


Bye!  :)
Title: Re:Hi-Color Pallete
Post by: Alynn on Tue 25/11/2003 16:30:39
Well that explains the number part...

Still doesn't explain why importing a background image with 253 colors gets its color reduced when making a 16 bit color game...
Title: Re:Hi-Color Pallete
Post by: Pumaman on Tue 25/11/2003 21:22:42
If your background image is saved as a 256-colour (8-bit) image in your paint package, AGS will try and import it as one.

Load the image into PSP or whatever, and upgrade it to a hi-color image, then save it again. AGS should now import it without any problems.