BMP vs. JPEG

Started by
0 comments, last by 1kevgriff 23 years, 2 months ago
I''ve been wondering... why as programmers do we use mostly bitmaps? They are huge files in contrast to JPEGs which are small sized. I''ve been wondering this, and I''d like to get some feedback. Why are bitmaps the preferred graphic format to use?
Advertisement
Because bitmaps are incredibly versatile, if you take the time to examine the file format. You mentioned JPEG as a viable format. I'd like to point out that JPEG uses a lossey compression algorithm, which means your images will always lose quality (although many times this loss is not perceptable). Also, JPEG is particularly horrid at reproducing scenes with lots of solid geometry (lines, primitives, etc.).

There is also greater overhead for loading compressed images, since they must be decompressed at run-time. This matters when you start using large numbers of images or textures. Bitmaps require no decompression. All images use up the same memory when decompressed anyway, so sometimes it's better just to leave them that way on disk. (And sometimes it's not.)

I'd also like to point out that JPEG only supports 16- and 24-bit color, whereas bitmaps support any color depth you can imagine (with the possible exception of 16-bit, but I only say this because I've never seen a 16-bit bitmap). In many cases, using higher color depths is superfluous since you can get away with an optimized 8-bit palette. For example, all textures in Unreal are 8-bit, but each has its own palette.

I agree with you that JPEG is a good choice, particularly for backdrops and other large, photo-realistic scenes. I plan to use them myself. However, I also plan to make gratuitous use of bitmaps and perhaps even PNG's, because PNG has all the versatility of bitmaps plus lossless compression.

By the way, PCX is a very horrible file format to use for textures. I managed to cut the size of Unreal Tournament's texture collection in half just by converting all the PCX images to bitmaps. RLE is not always a good thing.

Edited by - Tom on February 14, 2001 10:18:32 PM

GDNet+. It's only $5 a month. You know you want it.

This topic is closed to new replies.

Advertisement