Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Densun

Choosing a graphics file format

This topic is 6594 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m trying to decide on a graphics file format to use for my game but the decision is getting harder to make after reviewing some formats. Here''s the situation: BMP: I don''t want to use this because it''s Windows specific. Plus, I''ve written a loader for this once and it was a pain because of the way it''s stored. GIF: this has fallen into corporate greed (why I was thinking of PNG). It also doesn''t support colors above 8-bit. JPG: lossy storage format. The compression method is also very scientific, so I don''t feel like reading about it. PCX: nice and simple. Could be my choice. PNG: I like this because it was made to be portable and free, created after GIF was patented. This was sounding like a very good option, but after reading the official document it might have more stuff in it then I need. That extra stuff might also make loading images slower. I could also make a program to convert a file format into something I''ll create. Anyone have suggestions for other file types? All I need is high color support, no loss of data, and a compression method that doesn''t take long to decode. Choose a path: path one or path two

Share this post


Link to post
Share on other sites
Advertisement
well it depends on the game your making,, is it a 3d game or a 2d?
What Bit depth are you using?

i''m using PCX for my 2d game it works fine and it''s fast! sadly ,I don''t know about PNG...

Share this post


Link to post
Share on other sites
I could be wrong, but I don''t think that PCX supports higher than 8-bit color either. Even if it does, you probably aren''t likely to get good compression on any photorealistic images.

Although BMP format isn''t compressed, it really is probably the easiest. The only tricky part is the fact that the images are stored from bottom to top instead of top to bottom. Other than that, it is just a straight byte per byte image stored in the file. Not many tricks to it at all and no need to worry about some strange compression algorithm. If you can handle PCX, you should have absolutely no trouble at all with BMP.

Plus, there is no reason why you couldn''t use a BMP file on a platform other than Windows. A file is just a collection of bytes. It doesn''t matter what OS it is stored on, you can treat it the same anywhere.

If you absolutely must have some sort of compression and you want to use 16 or 24 bit color, I''m afraid that you''re probably going to have to learn some of those messy scientific compression algorithms. I would recommend just using something easy like BMP or TGA (which is similar) unless you are running into serious storage space problems.

Share this post


Link to post
Share on other sites
I think PNG is a good format.. It''s compressed very well, lossless, and is, like you said, free. If you don''t want to write a loader for it, you can go to the official site (I think www.libpng.org) and download libpng, which is an opensource, supposedly portable, library for working with the format.

Good luck!

Share this post


Link to post
Share on other sites
It's going to be a 2D game and the files should be stored in 24-bit color.

TGA is something I'm also thinking about, but it had lots of useless stuff in it as well.

I think I'll first try PNG and then TGA.

Choose a path:
path one or path two

Edited by - Densun on November 26, 2000 12:03:04 PM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
TGA is a simple bitmap format, it''s excellent, tried and true, easy to code and to implement.

Share this post


Link to post
Share on other sites
You could just have a custom format based on one of the above formats; just strip out that which you don''t need.

This also helps protect your artwork. Anyway, if you do this then you also need to write a converter to strip out the useless info, but after that your set.

Share this post


Link to post
Share on other sites
Making my own format for the game would be nice, but I want people to be able to edit the graphics. I''d have to also make it possible to convert back to the original and I might have a hard time writing the values correctly. I might give it a try.

Choose a path:
path one or path two

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!