Hi,
Anyway, my question may be more philosophical than technical, but here
goes: What is the preferred image format for games (like this one)?
Here are my “image loading experiences”:
At first, I used the Xpm library to load XPM files, but there were some people
which did not have this library or had problems to compile it, so I decided to
write my own image loading functions. Another reason was that the XPM image
format is a “human readable” image format (in fact, it’s C source) and therefore
produces quite large image files (which can be used in gzipped format with newer
versions of Xpm library).
So, I wrote a loader for GIF images for my games, because GIFs are
popular and quite small. But then there was all this Unisys trouble (regarding
not only programs that write GIFs, but also those that read them – in fact,
all programs that use their patented algorithms needed for GIF
encoding/decoding).
So I decided to drop the GIF format.
When looking for an alternative file format, I directly skipped the Windows BMP
format because of being so terribly bloated. Just get this single line from
"CHANGES.txt"
from Bill Kendrick’s SDL game “madbomber”:
- Zen mode background created at runtime (removing about 1MB of file data).
Hint: This file just contained two big, single colored rectangles…
I then took the PCX format, which is simple and produces relatively small files
(with a simple run length encoding, therefore produces files which are a bit
larger
than GIFs, but far away from those bloated BMPs).
This was before the PNG format was developed, so maybe I would choose the
PNG format now if I would again work on it.
When I started writing, I used GIF, because that and BMP were the only
SDL-supported choices at the time. Would I be better off with another
Now SDL’s IMGlib supports PCX and PNG, too.
format? (Will Unisys lawyers care if I release the game using GIF?)
Probably not, if it’s Freeware, but who knows exactly… :-/
What do you suggest, what are other people here using, and why?
Just my 2 cents. Hope you found something useful.
Best regards,
Holger–
Holger.Schemel at mediaWays.net ++49 +5241 80-1438