Image format

Started by
4 comments, last by Stephen R 18 years, 8 months ago
What image format is best for 2D games?
Advertisement
.BMP, because it's easy to read from. Also I know that if you have Adobe Photoshop, you can save BMPs in different quality modes and do other such stuff.

If you don't agree with me, then try [google].
The best thing to do is just choose whatever you think you'd prefer, and go for it. -Promit
orcfan32, I'd like to direct you to a quote in the For Beginners forum FAQ:
Quote:
Don’t answer questions that you don’t know the answer to. When you’re a beginner, there is nothing worse than bad information so please know what you’re saying before you say it.


The best image format for a 2D game depends on what you want to use the images for. For example, for creating rectangular (non-isometric) tiles on a single layer, you may want to use BMP. However if you want to create isometric tiles then you either need to add a image mask or an alpha channel. Adding an image mask to the BMP often requires doubling the storage size needed, and BMPs don't support alpha. In that case you may want to go TGA or PNG since both those support alpha channel. This also goes for if you wish to create multiple layers since that is also more easily done by using alpha channels. For sprites, image formats with alpha channels are also more easy to work with than BMPs with image masks.

In my current game project I use SVG for my image format, since that way I get rotation and zooming with no quality loss.

So if you want to mention what kind of 2D game you are creating we can give you a more focused suggestion.
For a 2D game you will probably want an image type with lossless compression. My personal preference is PNG. If you are using DX the D3DX texture loading functions can handle it. SDL's SDL_Image lib supports them too. And there is always libPNG if your graphics API doesn't support it.
The game is 2D non isometric tile base; I'm switch from using window based graphic functions to SDL.
Then just use SDL_Image. It will allow you to load most of the graphics formats you are likely going to use. So you can probably safely go with either PNG or TGA.

This topic is closed to new replies.

Advertisement