How to choose the right image file format for your needs.
BMP, GIF, PNG, JPG, what do all these things mean? Here is a brief guide about how to choose the format for your image files.
Your choice of file format really depends on how much detail and how many colors you want to lose. Lossy image file formats reduce the size of the image file by losing some detail or colors, hence the name!
In general WEB pages use lossy file formats, in order to reduce file size and thus speed up the display of pages.
BMP. BMP (BitMaP) files are the Windows "standard" image file format. I mean "standard" since 16 bit Windows 3.0. BMP image files are very bulky and unsophisticated. I cannot imagine any reason to store images in BMP format. It has lossy and lossless versions, but in both cases there are better alternatives.
GIF. Graphics Interface Format is a format with a limited amount of colors (in general a maximum of 256 colors per image) which has two advantages:
The disadvantages of GIF are:
PNG. The Portable Network Graphics format was designed to be a lossless format for use on the WEB (among other things). It does reduce the size of your files. However since it preserves all the detail and all the colors the size reduction is not as much as GIF or JPG. PNG is a good format for saving your images. Most modern browsers support PNG, you can see if yours does later in this article.
JPG. JPG stands for Joint Photographic Group, which is the name of the organization which created this format. JPG was designed for the storage of photographs and is in fact used in most digital cameras. It is lossy, so you do lose detail, but you can choose how much detail you lose.
In some paint programs you can set the JPG quality:
JPG is great for sending photographs via email, and for photographic images on the WEB.
Here are some examples in the various formats. You may not be able to see them all, it depends on your browser:
That last image really shows the problem with low quality JPG files. But look at the file size! Only 5Kbytes! Never mind the quality - feel the width!
You can see the problem with GIF files with large photographs in the next two examples. The first is a detail from a photo saved as PNG, fluffy clouds and nice shading. The second is the same detail after the image has been saved as a GIF file.
PNG and GIF details compared
See how GIF has run out of colors (it only has 256) when it tries to do the delicate shading of the sky.