Best image format for games?

I only ask this because I’m having problems with
jpg’s. They leave a massive amount of shaded color
around my image making blittling ugly. Where as bmp’s
are clean around the green screen/image. Alot of
people use gif, but is this safe being that gif’s are
old tech?__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.

GEM Products wrote:

I only ask this because I’m having problems with
jpg’s. They leave a massive amount of shaded color
around my image making blittling ugly. Where as bmp’s
are clean around the green screen/image. Alot of
people use gif, but is this safe being that gif’s are
old tech?

PNGs can be a nice alternative.–
Daniel Vogel
Programmer
Loki Entertainment Software

Jpg’s are lossy, which does funny things to color keys, bmps are huge.
The nicest format in SDL_Image is PNG, lossless, true color, and it
supports alpha channel. Only draw back is adding PNG support to
SDL_Image can be tricky sometimes, but it is’nt too bad.

Wesley Poole
AKA Phoenix Kokido
Tired of hiding behind a on-line only identity…
members.xoom.com/kokido
@Wes_Poole

GEM Products wrote:> I only ask this because I’m having problems with

jpg’s. They leave a massive amount of shaded color
around my image making blittling ugly. Where as bmp’s
are clean around the green screen/image. Alot of
people use gif, but is this safe being that gif’s are
old tech?


Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

GEM Products wrote:

I only ask this because I’m having problems with
jpg’s. They leave a massive amount of shaded color
around my image making blittling ugly. Where as bmp’s
are clean around the green screen/image. Alot of
people use gif, but is this safe being that gif’s are
old tech?

I’d agree with everyone else and say go for PNG. Unlike most other
formats it is actually well thought out and supports most features in
well defined and obvious ways.

gif only supports 8bit indexed images (ie using a palette). There are
also some patent issues floating around.

bmp doesn’t really do compression (the format supports it, but most
programs don’t bother, and just save out humoungous uncompressed
bitmaps).

jpeg (as mentioned before) is lossy. However, you can alter the level of
compression and it’ll be good for some purposes (eg huge backgrounds).
Main thing to avoid with jpeg is loading, editing and resaving them as
you’ll lose a bit of quality each time. Best to use some other format
during development and only convert to jepg when the imagery is
finished.
I did some tests a couple of large background images I’ve got (around 20
Meg uncompressed), and found I could generally get them down to 10% of
original while still looking acceptable. Depends on the individual image
of course.

I’ve heard jpeg can be a bad source for textures on 3D objects, as the
information removed by the compression becomes much much more obviously
defficient once you start applying lighting algorithms. Haven’t done any
tests yet myself though…

PNG doesn’t support odd pixel formats (eg 16 bit 555 or 565) which can
be a bit of a bummer, but it’s not usually too much of a problem in
practice. Usually you’d want to have you source gfx in 24 bit anyway and
then convert down to whatever format is optimal for the target video
hardware (eg some video cards prefer 555 16bit mode, while others use
565).

Ben.–
Ben Campbell (Antipodean Straggler)
Programmer, Creature Labs
ben.campbell at creaturelabs.com
www.creaturelabs.com

GEM Products wrote:

I only ask this because I’m having problems with
jpg’s. They leave a massive amount of shaded color
around my image making blittling ugly. Where as bmp’s
are clean around the green screen/image. Alot of
people use gif, but is this safe being that gif’s are
old tech?

GIF is probably a terrible format to use for games nowadays, what with
Unisys trying to cash in on their patents (like LZW), and its limitation
to 8-bit palettized color. JPG is an even worse choice because it’s a
lossy format, and is absolutely no good at all for graphic art such as
what you would use for games. BMP is an ok choice, but it has no
support for compression (M$ specified RLE compression for the format but
forgot about it completely), or transparency. TIF would be a good
choice because it offers the most flexibility, but the darned thing is
such an elephantine format that is difficult to decode. But overall,
the best choice would be PNG: no patent troubles, and a lot of features
useful for games, such as alpha channels, and unpatented compression.–
Rafael R. Sevilla <@Rafael_R_Sevilla> +63 (2) 4342217
Mobile Robotics Laboratory +63 (917) 4458925
University of the Philippines Diliman