So what format should you save your images in? What formats are supported? What are the advantages of each of the formats?
As a general rule of thumb, images which represent a photograph or contain a complex array of colours should be saved in a JPEG format. While images which contain areas of a common colour (such as a logo) should be saved in a GIF format. Very old browsers (Internet Explorer 2.x) only supported BMP (Windows Bitmap) formats. These days browsers support a large number of formats including: BMP, JPEG/JPG, GIF, PNG, FPX.
BMP (Bitmap) is the native image format for the Windows series and OS/2 operating systems. It provides Run Length Encoding (RLE1), though some instances that require the use of bitmaps do not allow the RLE versions.
It does not support transparency or layers.
Use the BMP format for Windows wallpaper and other system graphics. It is not recommended for the web.
1 -- Run Length Encoding (RLE)
A compression method that reduces file size by compressing repetitive information. RLE gains about 25% compression rate with layered images and is only slightly slower than not using any compression.
On the Web, on web pages and in publications, the GIF has become a de facto standard form for an image. It supports up to 8-bit colour depth images (256 colours), and it is optimised for high contrast images and blocks of colour. GIF89a supports animation as well as single colour transparency.
The GIF uses the 2D raster data type and is encoded in binary. There are two versions of the format, 87a and GIF89a. Version 89a (July, 1989) allows for the possibility of an animated GIF, which is a short sequence of images within a single GIF file. A GIF89a can also be specified for interlaced GIF presentation.
It does not support layers.
Use the GIF format:
This is a format used to transmit and store bitmapped images. It was created specifically for the Internet and other networks. It provides alpha transparency, high colour support, and slightly better compression than GIF. The current generation of Netscape Navigator and Internet Explorer may not completely support PNG and previous browsers do not support it at all.
While it supports alpha channels and creator information, it does not support layers.
Use the PNG format:
It is optimised for photographs and other continuous tone images, but does not do very well with line art, screenshots, cartoons and other high contrast images. It provides variable compression. The compression loses some of the original data, but does so by exploiting the fact that small changes in colour are less noticeable than changes in brightness.
It does not support transparency or layers.
A JPEG file is created by choosing from a range of compression qualities (actually, from one of a suite of compression algorithms). When you create a JPEG or convert an image from another format to a JPEG, you are asked to specify the quality of image you want. Since the highest quality results in the largest file, you can make a trade-off between image quality and file size. Formally, the JPEG file format is specified in ISO standard 10918. The JPEG scheme includes 29 distinct coding processes although a JPEG implementor may not use them all.
Together with the Graphic Interchange Format (GIF) and Portable Network Graphics (PNG) file formats, the JPEG is one of the major image file formats supported on the World Wide Web, usually with the file suffix of ".jpg". You can create a progressive JPEG that is similar to an interlaced GIF.
Use the JPG format:
Below is a chart which describes each format's advantages / disadvantages:
| BMP | GIF | PNG | JPG | |
| Browser support | ALL | ALL | IE 5+/NS 6+ | ALL |
| Transparency | No | Yes | Yes | No |
| Layers | No | No | No | No |
| Animation | No | Yes | Yes | No |
| Compression | Yes | Yes | Yes | Yes |
| Colours | 24bit | 8bit | 24bit | 24bit |