GIF animation

I am using gif animations in my game, for some
reason they suck they slow down my game alot.
I am not using gif individual images then animating them(should I be?).

What is the best graphics format to use for JAVA games?
Are JPEG’s able to have transperancy?
Is there a way to have JAVA set a transperancy color for the images?
Will more images slow down my game?(so, less tiles and more objects drawn to the background bitmap)
I am using a 64 x 128 gif character, if it helps and
64 x 64 tiles.
800 x 600 16bit 60hz

You probably want to use individual images. It’ll give you more control and be more efficient.

There is no “best” format to use for Java. Images get changed into an internal format. The difference would only be the number of bits per pixel.

If you have a search round on the wiki you should find a section about accelerated images. This should help.

The selection of image format is more to do with what you want from the image.

JPEG - No transparency, small files, loses detail in compression.

GIF - Single level transparency, smallish files, 256 colours only.

PNG - Alpha level transparency, bigger files, variable level bits per pixels.

HTH

Kev

I’ve found PNG file to be consistently smaller than GIF, as long as you properly match the bits per pixel… e.g. don’t compare 32bit PNG to 256 colour GIF.

I use PNG for most of my graphics now.

Thanks guys for your help, clears up a lot of things.

So, can you explain alpha in png a little more, like wich color is best for transparency?
Does anyone use jpg and png images together?

jpgs are a little naff for 2d sprites, for textures they work ok.

PNG supports a gradiant of trasparency, alpha. This means that you have 256 levels (depending on your bits per pixel) of transparency from completely see through to completely coloured. In this case you don’t have a “color” for transparency, you have a seperate channel altogether. Its not like in GIF where you have to choose to have a particular color as transparent.

Kev

http://www.libpng.org/pub/png/pngintro.html

That will answer several questions for ya…