Simple question from a beginner

Support for 8 bit might not be so important in the future as 16+ bit depths
become the norm. I’m basically doing the minimum I can get by with on
my projects. You might set up a 332 palette (3 bits red, 3 bits green, 2 bits
blue) and force people to live with how awful that looks under 8 bits.

I can’t answer your question though. My guess would be SDL would be smart
enough to do color mapping for you on the fly…

It is easy enough to do an experiment though.>I’ve just started using SDL and I’ve a simple question to ask.

I’m writing a little program using 8-bit video depth, and I tried to
visualize two different images with two different palettes : it seems to
work fine. So that’s my question : in a 8bpp mode can I use a different
palette from each image ??

Thanks for your help,
Andrea.

Hi all!

I’ve just started using SDL and I’ve a simple question to ask.
I’m writing a little program using 8-bit video depth, and I tried to
visualize two different images with two different palettes : it seems to
work fine. So that’s my question : in a 8bpp mode can I use a different
palette from each image ??

Thanks for your help,
Andrea.

Yes you can have multiple palettes, but you have to keep track of them
yourself.

		-fjr

Andrea wrote:>

Hi all!

I’ve just started using SDL and I’ve a simple question to ask.
I’m writing a little program using 8-bit video depth, and I tried to
visualize two different images with two different palettes : it seems to
work fine. So that’s my question : in a 8bpp mode can I use a different
palette from each image ??

Thanks for your help,
Andrea.

Support for 8 bit might not be so important in the future as 16+ bit depths
become the norm. I’m basically doing the minimum I can get by with on
my projects. You might set up a 332 palette (3 bits red, 3 bits green, 2 bits
blue) and force people to live with how awful that looks under 8 bits.

I can’t answer your question though. My guess would be SDL would be smart
enough to do color mapping for you on the fly…

It is easy enough to do an experiment though.

3-3-2 can work okay, but it is rather clunky… I remember using 676 colors
back when I did stuff in 8-bit color… That, coupled with dithering, produced
passable results… even at 320x200… (bare in mind I’m talking 1992 and
fairly dated hardware even then…) The math is a bit slower, because the
color axises aren’t on bit boundries, but it depends on what you need…

-Loren

Hi Andrea,

I can’t answer your question, but I have a few pointers to determine if you
are displaying more than 256 cols on an 8bit screen (how the heck could you
do that?). Firstly, have you got a utility to display the umber of unique
colours in a bitmap? That’d be a good start. Check if the number of unique
cols in bitmap 1 + unique cols in bitmap 2 is greater than 256. If it is,
I’m dumbfounded. If it isn’t, I’d guess SDL sets non used palette entries,
or it quantises the colours to the display pixel format (non palettised
mode). Does SDL support non palettised 8 bit modes?

Duh, I’ve got a cold and can’t think straight…

Cheers,

-Lea.

Andrea wrote:> Hi all!

I’ve just started using SDL and I’ve a simple question to ask.
I’m writing a little program using 8-bit video depth, and I tried to
visualize two different images with two different palettes : it seems to
work fine. So that’s my question : in a 8bpp mode can I use a different
palette from each image ??

Thanks for your help,
Andrea.

Does SDL support non palettised 8 bit modes?

No. :slight_smile:
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

I’ve just started using SDL and I’ve a simple question to ask.
I’m writing a little program using 8-bit video depth, and I tried to
visualize two different images with two different palettes : it seems to
work fine. So that’s my question : in a 8bpp mode can I use a different
palette from each image ??

SDL will map your images to the display as best it can.
If you are using an 8-bpp mode, the best thing to do is manage palettes
yourself by setting the appropriate one in the display whenever you change
image palettes. Many people create a single palette for most of their
artwork, and display using that palette.

See SDL_SetColors()

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Newsgroups: loki.open-source.sdl

Hi Lea,
Tanks for your answer. I counted the number of unique colors in my bitmaps,
and it’s less than 256. I think you’re right saying that SDL sets the empty
palette entries to show both bitmaps correctly. Sorry for the dumb question,
but I’m still learning how to manage images.
Thanks a lot.

Andrea.

Hi Andrea,

I can’t answer your question, but I have a few pointers to determine if
you
are displaying more than 256 cols on an 8bit screen (how the heck could
you
do that?). Firstly, have you got a utility to display the umber of unique
colours in a bitmap? That’d be a good start. Check if the number of unique
cols in bitmap 1 + unique cols in bitmap 2 is greater than 256. If it is,
I’m dumbfounded. If it isn’t, I’d guess SDL sets non used palette entries,
or it quantises the colours to the display pixel format (non palettised
mode). Does SDL support non palettised 8 bit modes?

Duh, I’ve got a cold and can’t think straight…

Cheers,

-Lea.

----- Original Message -----
From: lea.anthony@prismtechnologies.com (Lea Anthony)
To:
Sent: Thursday, November 18, 1999 11:10 AM
Subject: [SDL] Re: Simple question from a beginner

Hi lea & Andrea,

Try download my graphics library from www.tutok.sk/fastgl and see class
Bitmap and CreateColor() in fastgl.cc source file. Its have very powerful
colors management.

Marian K.