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.

DS development > Any way to use 24bit palettes?

#90993 - PacoChan - Mon Jul 03, 2006 9:24 pm

I ask this because when I draw certain 8bit bitmap on screen it appears with less colors and it looks horrible. This happens because when I load the palette, it only loads the 16bit colors. Any way to solve this?

Thanks.

#90994 - Sausage Boy - Mon Jul 03, 2006 9:29 pm

The DS can't handle 24bit colors, so don't use it. Which conversion tool are you using?
_________________
"no offense, but this is the gayest game ever"

#90997 - PacoChan - Mon Jul 03, 2006 9:43 pm

I'm using gfx2gba. But when I save the bitmap in 16bit color mode with photoshop it also appears horrible. So, if I can't use 24bit colors, is there any way to use a filter or a plugin to diffuse the colors with photoshop or something like that?

#91001 - Sausage Boy - Mon Jul 03, 2006 10:08 pm

The difference between 16bit and 24bit colors is barely visible unless you're using gradients, so I think you are confusing it with something else. Just save your image as PCX and things will probably work out.

Are you trying to display a paletted image? In that case, change mode to indexed with 256 colors before you save, if I recall correctly.

Some code would be nice, which mode you use and so on, and the command you use with gfx2gba. Also, which gfx2gba are you using? There are two very similar tools with the same name.
_________________
"no offense, but this is the gayest game ever"

#91017 - tepples - Mon Jul 03, 2006 11:57 pm

Have you tried doing the same thing on a GBA? Or can you manage to get one of your programs working in an emulator? If so, take a screenshot so that we can see what is going wrong and find the right solution.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#91049 - PacoChan - Tue Jul 04, 2006 7:39 am

I'm sure it's because the 16bit colors. This is how it looks when I save the bitmap with indexed colors: [Images not permitted - Click here to view it]

But this is how it looks in the Ds, that is the same as when I save it with photoshop in 16bit color mode: [Images not permitted - Click here to view it]

I have another images that look better, but this seems to have a lot of non 16bit colors.

#91150 - silent_code - Tue Jul 04, 2006 10:22 pm

i've got exactly the same problem... i was wondering what the hell was wrong, but the idea that it may be 24 to 16bit color conversion sounds right.

converting to 555 (gba) won't solve the problem, too. :(

i'm also using renders and it's the nature of such images to have some gradients (lighting).

#91152 - Mighty Max - Tue Jul 04, 2006 10:29 pm

There is an old method called dithering.

If you got a color that is somewhere inbetween color a and b, then you can tell, it takes x% of a and y% of b to mix this color. If you know this percentage you can simply mix this by a random:

Get a random 0-100
if random below x%, use color a else use color b
_________________
GBAMP Multiboot

#91155 - silent_code - Tue Jul 04, 2006 10:48 pm

sure, that will help. but one needs to modify the image (boring). i'll load up photoshop and dither that thing... we'll see if i'm stupid enough to fail ;p

EDIT:

i AM stupid enough... well, i bought that photoshop 6 to use it and i don't want to work with the gimb (i tried it, but found ps better). so, does anyone know how to dither an image from 24bit to 16bit in ps (some plugin... or what ever)? the only way i am able to create a 16bit image is to save it as a 16bit .tga. but it won't offer any dithering, just freak the colors up and make the gradients look wrong. looks just the same as using a 24bit image for a source. i tried the ditherbox plugin, but i don't think it's there to dither your image... it's a magic to tool to make your image look like crap by replacing it with garbage dither boxes...

any idea, anyone?

PS: i can't raytrace the image in 16bit :( i just rerendered it and set my desktop to 16bit... wooohooo, the same ugly waste, as expected. this kinda proves the issue comes from the conversion.

#91171 - tepples - Wed Jul 05, 2006 1:02 am

If you "add noise" at about 2% and then convert it, you might get better results.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#91186 - silent_code - Wed Jul 05, 2006 3:52 am

thanks for the tip, but i really want dithering... :( i'll check out what results i get, but i can't imagine there is no other way. (nice idea though [i mean it]! hiding the bad colors with noise ;D)

i remember i tried to export to .gif with dithering, but it was all messed up the same way (after displaying on the nds), so that means .gif uses 24bit palettes, too. :(

sad thing.

how is .pcx supposed to solve the problem? gimme a link or short introduction or something. thanks!

#91207 - melw - Wed Jul 05, 2006 9:23 am

There's image formats that support 16bit colours as well. If you're using Photoshop, just try saving as 16bit Targa - Photoshop should do the 24->16 bit conversion smoothly enough. Although even that might be RGB565 or something not totally equivalent to DS' RGB555.

One might always write own tools to deal with the image conversions no matter what the source is.

#91226 - silent_code - Wed Jul 05, 2006 12:31 pm

melw wrote:
There's image formats that support 16bit colours as well. If you're using Photoshop, just try saving as 16bit Targa - Photoshop should do the 24->16 bit conversion smoothly enough.


that's what i just said... .tga won't do it. :(

imo, it's inefficient to write tools that have been written a 1000 times before (and possibly are better then oneself could do). i mean there has to be some pluging for ps or something.

most images just won't look bad in 16bit color. but some do. :( from what i've seen it looks like bright light to quite dark gradients will mess the image up. i have some raytraced images that are fine, even though they are dark and others (justa few) that look messed up. maybe i'll have to modify the image (some gamma correction or whatever) to avoid that problem. i still have to check the noise hack.

@Paco: i'll try to work with the desktop colors set to 16bit and then play around with gamma and stuff. maybe you should try that too.

#91286 - josath - Thu Jul 06, 2006 2:55 am

a quick google turned up this page, which gives an example using ImageMagick. maybe this will give better results:

http://benno37.livejournal.com/10678.html