Dangerous Minds
FAQ: Why the Shop uses JPEG Specimen Images

As you may have noticed, Bob's Rock Shop uses the JPEG (Joint Photographic Experts Group) format for prsenting specimen images on its pages almost exclusively. I'm often asked why I present specimen images with a "lossy" format like JPEG as opposed to the still too often encountered "lossless" GIFs. Well, the first iteration of specimen images for the Shop in early 1995 were done in GIF format with the idea of making them "universally" browsable. At that time, Netscape's contoversial, upstart Navigator was the only WWW browser incorporating native support for inline JPEG images!

However, the use of the GIF format had two effects that I was concerned my "phone customers" would find less than desirable. Most of my fellow rockhounds and computer hobbyists are accessing the WWW just like I do, with a telephone modem and a connection through a commercial service provider of some sort. The first and least tolerable effect for phone connected web browsers is the file size required by photo-realistic GIFs. The GIF format works quite well for compressing line-art or images with relatively large contiguous areas of identical color. As an extreme example, a 640x480x16 (4-bit) GIF of a solid, single color field takes under 1 KB; as a 640x480x256 (8-bit) GIF, this simple "image" takes under 2 KB. Line-art type images of comparable screen size require larger files, of course, but the GIF format excels at storing this type of image efficiently. Here's an example of the sort of image that "likes" GIF:

640x480x256 GIF 89A, 25.7 KB

GIF is where it's at for line-art! In fact, this type of image looks really terrible when compressed by JPEG to a comparable file size:

640x480x16M JPEG, 26.4 KB

However, the tables turn completely when we consider photo-realistic images, which are characterized by large color palettes and very small areas of contiguous, identical color. The GIF format is not nearly as efficient in storing this type of image. A 900+ KB 640x480x16M (24-bit) BMP or TIFF mineral specimen image output by a frame grabber or scanner will typically reduce to about 200 KB or so when compressed by conversion to GIF. Now, a 200 KB file doesn't exactly transfer across a phone line in the blink of an eye, even with the best 28.8 modem!

The other less than desirable effect that's inherent with the GIF format becomes apparent when you consider that most of its compression with photo-realistic images is achieved by reducing the 24-bit (16 million) color palette of a true-color image to the GIF's maximum 8-bit (256) color palette. That's not exactly what I think of as "lossless" compression! JPEG is a 24-bit image format and JPEG compressions of "true color" bitmapped formats like BMP or TIFF do not drastically dither down their color palettes as does GIF.

With JPEG, a 900 KB 640x480x24-bit photo-realistic bitmapped image output by a frame grabber or scanner can often be compressed into the range of 25-50 KB or so before it begins to compare too disfavorably on a visual basis with it's 200 KB GIF counterpart. And of course the time required to move the 25-50 KB JPEG image over a phone line compares very favorably with the time required to move a 200 KB GIF.

What does this much higher compression cost in photo-realistic image quality? Here's a demonstration that provides a GIF version of an image as a reference and several JPEG versions for comparison. You might want to try timing the transfer of each image the first time you click it. (If you want to repeat the timing part of this demonstration, you'll need to clear your browser's cache memory first.) These demo images are all format conversions of a 640x480x24-bit TIFF, which weighs in at a fairly hefty 921 KB.

640x480 GIF 89A 253 colors: 213 KB

640x480 20% JPEG 123K colors: 65.1 KB

640x480 50% JPEG 123K colors: 37.9 KB

640x480 80% JPEG 111K colors: 21.6 KB

640x480 90% JPEG 73K colors: 13.7 KB

In case you're wondering, that's Orange Wulfenite with Mimetite from San Francisco Mine, Cucurpe, Sonora, Mexico.

A major attraction of the JPEG format is that it does not dictate any particular compression ratio. The trade-offs to be made between file size and image quality are determined by setting a "quality level" control on the JPEG compressor software. Most of Bob's Rock Shop's larger (640x480ish) specimen images are in the 25-50 KB size range. The JPEG format was designed to achieve very high compression with photo-realistic images. There is a lot of confusion and misconception surrounding JPEG. It's often disparaged as a "lossy" format. "Lossy" it is, but JPEG's "lossy" characteristics are pragmatically irrelevant as far as presenting images for viewing on the WWW is concerned. If you'd like further information on the JPEG format, the Usenet JPEG FAQ provides a nice introduction.

By using JPEG images (and encouraging you to use the Netscape Navigator browser) I've done about all that I can for my fellow phone browsers. Sorry, but I don't support Lynx. ;) Now, if you're still browsing with a 14.4 modem, how about meeting me half way? Junk that 14.4 and treat yourself to the 28.8 (or faster!) you've been threatening to get... Just do it!

FAQ List

Table of Contents

bkeller@rockhounds.com 5/23/97