Re: Questions about colors and palettes

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hey, the To: field doesn't look right...... Hmmm. Anyway......

>I've got some questions about 256 color mode and palettes.
>
>I (think) I understand the following:
>
>1. Colors are referenced by numbers on the PC.

0-15 or 0-255, yeah.... (16 and 256 color modes, respectivly)

>2. These numbers are used as indexes into a palette.

Right.

>3. Bitmaps come with two chunks of information: the bitmap, and their
>own palette.

As far as Euphoria's loading routines are concerned....

>4. The bitmap palette colors are arranged (in theory) in order of =
>importance - so color #1 really should have an absolute match, while =
>color #150 can have a "close match".

I dunno. With the default palette, the first 16 (0-15) are usually the
same, and the rest are the same colors repeating, getting from bright to
dark. I think. In the source code for simple arcade games that I've seen,
the later colors are the ones used for palette rotation for blinking
lights and such. The earlier ones are used more often for the rest of the
colors.

>I'm less clear on how to deal with colors from various competing
>sources. For example, if I go to load a bitmap, it will replace the
>current palette with it's own - and likely ruin any prior images that
>were displayed.
>
>So it would seem the thing to do would be to set up the palatte with
>the first 32 colors or so reserved for "default" colors, and build the
>rest of the palette with an even spread through the spectrum. When
loading
>a bitmap, you would then replace the colors in the bitmap with a "close
>match" to those colors. This would prevent the color scheme of the
>rest of the display from being destroyed, and display colors more or
less
>correctly.

Why not just try to keep both bitmaps using the same palette? Using the
completely default color map if possible? That would really keep things
simple.

>Using the same scheme, you would be able to display 256 color bitmaps
>in 16 color mode as well - albiet, with a much more limited palette.

Yeah.... As I understand it, it is possible to find a close or exact
match to a color. It's how Pete did the transparancy in the ModeX
demos....

>I'm a bit confused, because Irv loads bitmaps in his Windoz program
>with no visible side effects. Is there something I'm missing? If the
method
>I've described is correct, has someone already written as set of tools
>to "average" a bitmap? Is there a better way to do all this?

Just try to keep the same palettes and you won't have to worry about
it.... :)

My two cents.


_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu