WWW FAQ: Which format is better for WWW image purposes, JPEG or GIF?


Which format is better for WWW image purposes, JPEG or GIF?

Almost all browsers can view inline JPEG, and there are free libraries available to do that, so the remaining browser vendors are very short on excuses. There is no need to avoid inline JPEG any longer. So the proper question is, which format is better for your specific purpose?

JPEG is for photographic images. GIF is for line-art images, such as icons, graphs and line-art logos. You will very likely find that JPEG produces smudgy line art and GIF produces large and washed-out photographs. Use them accordingly.

However, never convert GIF to JPEG if you can possibly help it. Once your photograph has been reduced to the mere 256 colors supported by GIF, it's too late. Go straight from a lossless 24-bit format supported by your scanner, such as TIFF or PNG, to JPEG.

Since JPEG is an approximate representation of the image, you shouldn't save things as JPEG and then edit them further later and save them again. You can expect progressive loss of quality each time you do that, especially with different JPEG quality settings. If you must edit a photographic image, work with it in TIFF or PNG format until it is ready for publication, then convert it to JPEG for the web.

If your images can't tolerate being reduced to 8 bits for GIF or losing precise accuracy for JPEG, TIFF and PNG are your best options. Web browsers are beginning to support the latter, and many external viewers support both. The vast majority of websites should be using GIF for line art and JPEG for everything else, and migrating from GIF to PNG as browser support for PNG becomes more widely available.

Also see the Independent JPEG Group's JPEG FAQ <URL:http://www.cis.ohio-state.edu/hypertext/faq/usenet/jpeg-faq/top.html> for more information about JPEG and software that can produce JPEG-format images, including progressive JPEGs.


World Wide Web FAQ