Re: 8-bit vs. 24-bit color

Sandeep Somaiya (mailto:sandeep@NEXT2.VTLS.COM)
Thu, 15 Sep 1994 22:21:31 -0500

Message-Id: <mailto:199409181037.FAA10127@library.wustl.edu>
Date:         Thu, 15 Sep 1994 22:21:31 -0500
From: Sandeep Somaiya <mailto:sandeep@NEXT2.VTLS.COM>
Subject:      Re: 8-bit vs. 24-bit color
To: Multiple recipients of list IMAGELIB <mailto:IMAGELIB@ARIZVM1.BITNET>

>>As soon as you zoom in on the GIF file in comparison with the
>>JPEG file, the quality difference is dramatic (GIF does not
>>handle this well)
I agree but not always true. When to use GIF and when to use JPEG? GIF does significantly better on images with only a few distinct colors, such as line drawings and simple cartoons. Not only is GIF lossless for such images, but it often compresses them more than JPEG can. For example, large areas of pixels that are all "exactly" the same color are compressed very efficiently indeed by GIF. JPEG can't squeeze such data as much as GIF does without introducing visible defects. (One implication of this is that large single-color borders are quite cheap in GIF files, while they are best avoided in JPEG files.) Generally speaking, JPEG is superior to GIF for storing full-color or gray-scale images of "realistic" scenes; that means scanned photographs and similar material. Any continuous variation in color, such as occurs in highlighted or shaded areas, will be represented more faithfully and in less space by JPEG than by GIF. Computer-drawn images (ray-traced scenes, for instance) usually fall between photographs and cartoons in terms of complexity. The more complex and subtly rendered the image, the more likely that JPEG will do well on it. The same goes for semi-realistic artwork (fantasy drawings and such). JPEG has a hard time with very sharp edges: a row of pure-black pixels adjacent to a row of pure-white pixels, for example. Sharp edges tend to come out blurred unless you use a very high quality setting. Edges this sharp are rare in scanned photographs, but are fairly common in GIF files: borders, overlaid text, etc. The blurriness is particularly objectionable with text that's only a few pixels high. If you have a GIF with a lot of small-size overlaid text, don't JPEG it. I do realize that this discussion is basically concentrating on color/grayscale but am still including this point: Plain black-and-white (two level) images should never be converted to JPEG; they violate all of the conditions given above. You need at least about 16 gray levels before JPEG is useful for gray-scale images. It should also be noted that GIF is lossless for gray-scale images of up to 256 levels, while JPEG is not. [based on discussions from USENET_JPEG Compression discussions and Independent JPEG Group]

Sandeep Somaiya VTLS Inc. "Look, Learn, Listen ...... Libraries change Lives"