10.2 Examining Image Formats


10.2 Examining Image Formats

Because images were first digitized and stored as files, over 50 formats were developed to standardize their recording and viewing. Table 10.3 provides a summary of the file format extension, file format source, and the support of different color depths for 30 commonly encountered raster images.

Table 10.3: Common Raster Image File Extensions, Sources, and Color Depth Support

Color Depth Support

1

4

8

8

24

File Extension

Source

Gray Color

BMP

Microsoft Windows RGB encoded

BMP

Microsoft Windows RLE encoded

BMP

OS/2 RGB encoded

CLP

Windows Clipboard

CUT

Dr. Italo

DCX

Multiple PCX images

GIF

CompuServe

IMG

Gem Paint

JPG

Joint Picture Experts Group

MAC

MacPaint

PCD

Kodak Photo CD

PCX

ZSoft PaintBrush

PCX

ZSoft PaintBrush Version 2

PCX

ZSoft PaintBrush Version 3

PCX

ZSoft PaintBrush Version 5

PGM

UNIX

PIC

PC Paint

PCT

QuickDraw Picture

RLE

Microsoft Windows

TGA

True Vision (Targa)

TIF

Aldus Corp Huffman Compressed

TIF

Aldus Corp No Compression

TIF

Aldus Corp Packed bits

TIF

Aldus Corp LZW compression

TIF

Aldus Corp G3 compression

TIF

Aldus Corp G4 compression

WMF

Windows Metafile

WPG

WordPerfect Version 5.0

WPG

WordPerfect Version 5.1

WPG

WordPerfect Version 6.x

10.2.1 Common Formats

Of those images listed in Table 10.3, a core set of five probably represents a large majority of the methods by which images are stored and viewed . Table 10.4 includes a list of five file formats, as well as a more descriptive explanation of each file format than contained in Table 10.3.

Table 10.4: Common Image File Formats

Extension

Description

BMP

The Microsoft Clipboard and file format, which stores images in a bitmap format and optionally supports RLE compression.

GIF

CompuServe's Graphical Interchange Format stores images using a 12-bit Lempel-Ziv Welch (LZW) lossless compression technique.

JPG

The Joint Picture Experts Group (JPEG) standardized the storage of images based on the ability of the user to specify the removal of details via a lossy compression method.

PCX

The ZSoft PaintBrush image format uses a run length limited (RLL) lossless compression method.

TIF

The Tag Image File Format (TIFF) represents a specification for the storage of images that was jointly written by Aldus Corporation and Microsoft. Although the copyright is held by Aldus, the specification is in the public domain. TIFF supports five compression methods ” one lossy and four lossless.

10.2.1.1 BMP

The Microsoft Windows bitmap format (BMP) can store black & white and color images. Because one version of this format does not use any compression, resulting files can be extremely large; however, they provide a mechanism for comparing the storage efficiency of other image formats. An option supported by the BMP image format includes the use of a Run Length Encoding (RLE) compression scheme. Under RLE, repeated runs of pixels are compressed, which can result in a smaller BMP file. Although the use of RLE compression makes you expect that the resulting compressed image will be smaller than a noncompressed BMP image, this is not always the case. A " noisy " image, which has many translations of color depth, object changes, and other irregularities, may well result in an expansion of storage when compressed using BMP's RLE compression option. This expansion results from characters required to denote the occurrence of compression adding to the size of the file when runs of the same pixel color depth are relatively short.

Because RLE compression is fully reversible, there is no loss of image quality when the compressed data is decompressed by a BMP viewer. The RLE compression method is referred to as lossless compression because all pixels in the original image are restored upon decompression .

10.2.1.2 GIF

The CompuServe Graphical Interchange Format (GIF) represents one of the earliest developed image storage and viewing formats, with the first GIF standard developed in 1987, while a downward compatible standard was developed during 1989. GIF was widely used by electronic bulletin board systems as it was among the first to incorporate data compression, using a 12-bit Lempel Ziv Welch (LZW) technique. The LZW compression technique typically provides a 2:1 to 3:1 reduction in the amount of data storage required to store an image in comparison to storing it in its original bitmapped format.

LZW is one of several string-based compression methods that is fully reversible. That is, the decompression algorithm when applied to a previously compressed file results in the recreation of the original file on a bit-for-bit basis without any loss of data. Due to this, this type of compression is also known as lossless compression .

10.2.1.3 JPG

The Joint Picture Experts Group (JPEG) standardized a method of image storage and viewing based upon a series of compression methods. Although the technique is referred to as JPEG, the file extension resulting from an image stored using the JPEG technique is JPG, a carryover from the DOS and non-Windows 95 limitation of a three-character file extension.

JPEG image compression is based on the transformation of 8 8-pixel blocks of a true color image into luminance and chrominance levels. Each block is processed by a two-dimensional discrete cosine transformation to obtain 64 coefficients representing the block. Those coefficients are quantized by predefined tables for luminance and chrominance components , after which information about the block is packed into lower-frequency coefficients. This results in many coefficients being represented by 0's and 1's, which facilitates the compression of data representing the image.

Many imaging programs that support JPEG enable a user storing an image to adjust the quantization tables by defining a quality value. At the default of 75 used by most programs, relatively little picture degradation occurs; however, a significant amount of compression may be obtainable. At lower quality values, slightly better compression results are obtainable but a marked loss of image quality occurs when decompression occurs and the previously compressed image is viewed. Other imaging programs do not permit a user to directly alter the quantization tables by defining a quality value. Instead, they may internally define several quality values and associate those values with the terms "least," "moderate," and "highest" or similar meaning descriptors. Then, selecting a compression level descriptor results in the program using a predefined quality value.

The adjustment of JPEG quantization tables by specifying a quality value using a program compression descriptor, or using a program's default, results in a permanent loss of image details. Thus, the method of compression used by JPEG is referred to as lossy because decompression does not result in the exact reconstruction of the original image. However, while lossless compression is extremely important when working with data files that can include financial information, word processing files, and similar information, a small loss of image quality may not be perceptible to the human eye. Unlike the storage of data files, which must be compressed using a lossless compression method, a degree of lossy compression is typically tolerable when working with most images. The trick when using a lossy compression method is similar to having self-control at an " all-you-can-eat " buffet. That is, do not overindulge, for an excessive amount of lossy compression will result in a bad visual feeling from a distorted image. If you are using an imaging program that directly supports the entry of a quality value, care should be taken when selecting values under 50. At or under a quality value of 50, depending upon the image, you may begin to notice the 8-bit 8-bit blocks as they begin to become more pronounced due to excessive pixel loss. As we shortly note, you can obtain a significant data reduction through the use of the default quality value of 75, resulting in an image essentially indistinguishable from the original.

10.2.1.4 PCX

The PCX image format was developed for the ZSoft PC PaintBrush image editing program and represents one of the first graphics formats used with the IBM PC and compatible computers. The PCX format is supported by many DOS and Windows based programs and supports color depths ranging from black and white to 24-bit true color.

PCX uses a run length compression method that results in a repetitive sequence of bits being replaced by a repeat count byte and a data byte. Run length compression is a lossless compression method that results in the recreation of an exact duplicate of the original image. The simplicity of the run length compression method results in coding and decoding operations occurring relatively fast; however, this compression method is, in general, inferior to the LZW compression method used in the GIF and supported as one of several compression methods by the TIFF image format described next .

10.2.1.5 TIF

The first Tag Image File Format (TIFF) specification was jointly developed by Aldus, Microsoft, and several scanner manufacturers during 1986 as a mechanism to standardize a file format for images used in desktop publishing. Since then, a number of specification revisions occurred that expanded TIFF support to digital video images and increased the number of compression methods that can be used to reduce image storage requirements.

TIFF supports five compression methods ” four lossless and one lossy. Lossless compression methods supported include two types of ITU-T (formerly CCITT) Group 3 and one method of Group 4 compression primarily associated with the use of fax, and LZW compression. A lossy JPEG compression method was added in TIFF specification revision 6.0. A TIFF-compatible file generator program must support at least one compression method, while a reader should be capable of supporting all compression methods. Similar to JPEG, TIFF files are commonly stored using a three-character extension, which explains why the second F is not used.

Although the TIFF specification is supported by a large number of popular programs, there are a large number of options associated with the use of many programs that require some thought prior to clicking on a button or entering a command. Some programs use a default of no compression when TIFF is selected, which as previously discussed, will result in a maximum amount of storage used for the image. Other programs provide support for a large number of patterns that can be used for storing different types of images. Forgetting to set an appropriate compression method or the selection of an unnecessary pattern can result in a file storage size that warms the heart of a disk drive manufacturer. When placed on a LAN, the noncompressed image can result in a minimum of some degraded performance being experienced by other network users. Adding to unintended effects, in some situations where large images or a large number of images are transmitted, the delays due to their transport can result in session timeouts as well as significantly degraded performance.

To obtain an appreciation of the effect of LAN-based images as well as techniques that can be used to minimize the effect of their storage and transmission requires an image with which to work. Due to the problems of copyright, this author decided not to use a picture of the Brooklyn Bridge, a famous museum, or another object that might be difficult to obtain permission to use. Instead, he used a photograph of his daughter as a basis for reviewing key concepts that will facilitate the use of images on a network.

Figure 10.1 illustrates the scanned image of an approximate 8 10-inch photograph of this author's daughter, Jessica Held Vanny. When stored using TIFF without being compressed, the file required 2,494,045 bytes of storage.

click to expand
Figure 10.1: An 8 10-Inch Photograph of the Author's Daughter Stored as a Noncompressed TIF File

10.2.2 Comparing Storage Requirements

To illustrate the differences in data storage resulting from the use of other image formats, the author used the Image Manager program, which is part of the Collage Complete image suite of programs from Inner Media, Inc., of Hollis, New Hampshire. Image Manager supports ten distinct file formats, permitting the original scan to be easily altered from its TIF format without having to rescan the photograph.

Figure 10.2 illustrates the Image Manager main screen after the previously scanned photograph was retrieved through the use of the program's File Open menu option. Because the photograph was scanned along its vertical axis, Figure 10.2 illustrates the initial selection of the program's Flip/Rotate option to reposition the image lengthwise to provide a more conventional view of the image. Figure 10.3 illustrates the result obtained by selecting a 90 clockwise rotation of the image. In the remainder of this chapter, we work with the image illustrated in Figure 10.3, transforming the TIF image format into other popular image formats so we can examine the effect of different formats on data storage requirements and transmission time on a network.

click to expand
Figure 10.2: Using the Collage Image Manager to Rotate the Retrieved TIF Image 90
click to expand
Figure 10.3: The Resulting Rotated Image that Will Form the Basis for Performing Several Image Conversations and Image Manipulation Operations

Figure 10.4 illustrates the Collage Image Manager program's "Save Image As" window with its image format box selected to illustrate the file formats supported by the program. Although the program supports ten distinct image file formats, it actually supports over 20 formats if you consider the fact that several formats include different sub-formats based upon the program's support of one or more compression methods for several formats. Although this author used the Collage Image Manager program to perform his conversions, it should be noted that there are numerous programs that provide this capability. Some programs, such as Paint Shop Pro, can be obtained from many Internet shareware Web sites, requiring the payment of a nominal fee after a typical 30-day trial period. Other programs, such as the Collage Complete suite or the popular Hijack suite, are well-known commercial programs advertised for sale in many trade publications or available for download directly from the vendor's Web site.

click to expand
Figure 10.4: Through the Collage Image Manager's "Save Image As" Option You Can Store a File in a Different Format

10.2.2.1 File Format Comparisons

Table 10.5 summarizes the storage requirements of different image file formats based on their conversion from the original scanned picture that was stored as a noncompressed TIF file. In examining the entries in Table 10.5, it should be noted that each image format was stored as a 256-level, true gray, 8-bit-per-pixel color type.

Table 10.5: Comparing Image Format Storage Requirements

File Format

Description

Data Storage (Bytes)

TIF

TIFF noncompressed

2,494,095

TIF

TIFF LZW-compressed

1,950,970

BMP

Windows Bitmap non-compressed

2,781,122

BMP

Windows Bitmap RLE compression

2,494,582

DCX

Multiple PCX color images ” no compression

2,634,995

GIF

CompuServe Graphics Interchange LZW compression

1,803,744

JPG

JPEG Least Compression

1,365,036

JPG

JPEG Moderate Compression

163,888

JPG

JPEG Highest Compression

84,973

PCT

Quick Draw Picture ” no compression

2,571,200

PCX

PC PaintBrush ” no compression

2,634,591

TGA

Targa ” no compression

2,492,079

WMF

Windows Metafile

2,494,670

Also note that in comparing the data storage requirements of each image, the presence or absence of compression as well as the type of compression used can have a considerable effect. For example, the noncompressed TIF image required 2,494,095 bytes of storage, while the same image stored using TIF's lossless LZW compression technique required 1,950,970 bytes of storage. Thus, simply changing the TIF file format to support its lossless compression method, which has absolutely no effect on the clarity of the image when it is decoded, results in a (2,494,095 ˆ’ 1,950,970)/2,494,095 or approximate 22 percent data storage reduction. Because transmission time is usually proportional to the size of a file under normal network operating conditions, you can reduce the transmission time of the image by 22 percent by storing it in a compressed form. As network utilization increases on an Ethernet LAN, the additional effect of collisions will be reduced by transmitting images in their compressed format. In certain situations, a reduction in the file size of an image by 20 percent might well result in a 100 percent or more reduction in the transmission time of an image on a heavily utilized local area network.

10.2.2.2 Examining Visual Image Differences

To illustrate the visual differences between the original image and several converted images, Figures 10.5 through 10.8 represent the printout of four converted image formats.

click to expand
Figure 10.5: Display of the GIF Image Format of the Author's Daughter
click to expand
Figure 10.6: A Printout of the Image AFTER Its Conversion to JPG Using the Collage Image Manager's Least Compression Specification
click to expand
Figure 10.7: Printout of the File Stored Using Moderate JPG Compression
click to expand
Figure 10.8: Printout of the File Stored Using the Highest JPG Compression Supported by the Collage Image Manager Program

Figure 10.5 illustrates the display of the GIF image format of the author's daughter. Through the use of the lossless LZW compression technique, the data storage requirement of the file was reduced to approximately 1.8 Mbytes. While less than the noncompressed TIF file, this reduction is significantly more than the storage required when the original TIF image was converted to several types of JPG images which are discussed later in this section. From Table 10.5 you will note that other than the use of JPG file formats, GIF provides the best overall compression performance. Because the use of JPG can result in a considerable data reduction beyond that obtainable from lossless compression techniques, let us focus our attention on the results obtained from converting the original TIF image to JPG using different quality values.

10.2.2.3 Considering JPG

Figures 10.6 through 10.8 illustrate the printout of the image after it was converted to JPG by specifying least, moderate, and highest compression. These three compression descriptors correspond to quality values of 97, 90, and 70, respectively. If you compare Figures 10.6 through 10.8 to the original TIF image in Figure 10.1, focusing on the facial features of each image, you may notice a very slight difference between the JPG and TIF images. The difference becomes slightly more pronounced when comparing Figure 10.8 and Figure 10.1.

In comparing Figures 10.6 through 10.8 to Figure 10.1, it is important to note the application being used. For example, if your network user image operations are oriented to storing pictures of persons or places for a visual database application, a slight degree of image distortion may be an acceptable price to pay for the significant reduction in data storage that becomes obtainable. For our example, the data storage required for Figure 10.8 is 84,973 bytes, which as you will note from Table 10.5 is approximately 1/30th of the data storage required by the noncompressed TIF file shown in Figure 10.1. In comparison, if the images will be used in a desktop publishing application where clarity is of extreme importance, you would more than likely restrict compression to the lossless method. Similarly, when working with medical images, such as a chest x-ray where the loss of even one pixel could result in a misdiagnosis, you should never consider the use of a lossy compression method.

10.2.3 Additional Image Management Operations

Through the use of scanner software or an image management program, you obtain the ability to perform a variety of functions that affect the storage and transmission time of images. In addition to selecting an appropriate file format to include the use of compression, you can consider such operations as image cropping and color reduction, as well as changing the resolution of a scanned image.

10.2.3.1 Image Cropping

Image cropping provides you with the ability to eliminate unnecessary portions of an image that obviously reduces its storage requirements. To illustrate the effect of cropping, the compressed TIF and moderate compression JPG images were cropped. Figure 10.9 illustrates the cropped TIF image while Figure 10.10 illustrates the cropped JPG image. In comparing the cropped images to the original size images, you will note that the background eliminated is more than likely unnecessary if the image is to be stored on a photo-ID database used to provide guards with pictures of employees or for similar applications. The author's cropping effort reduced the TIF file to 1,156,975 bytes while the moderately compressed JPG file was reduced to 98,153 bytes of storage.

click to expand
Figure 10.9: Cropped TIF File Using LZW Compression (Requires 1,156,975 Bytes of Storage)
click to expand
Figure 10.10: Cropped Moderately Compressed JPG File (Data Storage Reduced to 98,153 Bytes)

10.2.3.2 Color Reduction

Concerning color reduction, there are several questions persons working with images should be asked. First, do they really require a true-color 24- or 32-bits-per-pixel image for applications that never see a printed page? For example, does it make sense to scan photographs of employees using a 24-bit-per-pixel color depth? Perhaps 256-color (8 bits per pixel) or even a 16-level true gray using 4 bits per pixel might be sufficient. In fact, once an image is placed on a server, you might wish to review its color depth with respect to its application through the use of an image management program. For example, returning to the Collage Image Manager program, Figure 10.11 illustrates the selection of the program's Change Image Type option window that was displayed by selecting the option from the program's Transform menu. In Figure 10.11 the NewType list was selected to provide readers with a visual indication of the color depth types supported by the program for TIF formatted files. Many times, you can significantly reduce the storage requirements of an image by changing its color depth.

click to expand
Figure 10.11: Collage Image Manager Change Image Type Window

Now that we have an appreciation for software-based techniques we can consider for altering the storage requirements and network transmission time of images, let us turn our attention to hardware-based techniques.




Enhancing LAN Performance
Enhancing LAN Performance
ISBN: 0849319420
EAN: 2147483647
Year: 2003
Pages: 111
Authors: Gilbert Held

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net