gineering Library @ McGraw-Hill (www.digitalengineeringlibrary.com) Copyright © 2004 The McGraw-Hill Companies. All rights reserved. Any use is subject to the Terms of Use as given at the website. Protocols Protocols efficiently by GIF. However, JPEG has a hard time compressing such data without introducing visible defects. Computer images, such as vector drawings or ray-traced graphics, are typically somewhere between photographs and line drawings in terms of their complexity in the eyes of the compression algorithm. The more com- plex the image, the more likely JPEG will be able to achieve significant levels of compression of the image. This is equally true with natural art- work. On the other hand, icons made up of only a few colors are better handled by GIF. JPEG has difficulty achieving satisfactory compression with long, sharp edges. For example, if the image to be compressed has a row of black pixels immediately adjacent to a row of white pixels, the edges will often appear blurred unless a very high-quality setting is used-which, of course, reduces the degree of compression that JPEG will attempt to achieve. The good news is that such long, sharp edges are relatively uncommon in scanned photographs but are common in GIF files. Remember, straight lines are rare in nature, the subject of most pho- tographs. They are quite common, however, in line drawings and illus- trations. As a result, GIF is typically a better choice for compression of these image types. As a general rule, two-level black-and-white images should not be con- verted to JPEG because they (by their very nature) violate the conditions listed previously. Gray-scale images that have 16 gray levels are far more acceptable to JPEG. However, GIF is considered to be a lossless encoding scheme for images of up to 256 levels, while JPEG continues to be lossy. How JPEG Works The actual mechanical and mathematical processes that govern JPEG's inner workings are quite complex and will not be covered in detail here. Readers interested in more detail are