Compressing and Decompressing TIFF Images  Home  PDF2Image  ScreenShots  Articles  Products  Downloads

Compressing and Decompressing TIFF Images

To save disk space and quickly transmit TIFF images, you can compress images using the compression function in VeryPDF PDF To Image product. You can use the following methods of compressing and decompressing the types of images shown in parentheses:

Choosing A Compression Method

To compress images, you need to experiment with the various compression methods on various types of images. You can use the following general guidelines as a starting point:

Except for the last guideline which applies to the industry standard support of Packbits compression, these guidelines are based on the following factors:

Using compression on various images, you can determine how each compression method affects these factors, which are described in the following sections.

Quality of the Image

The quality of an image after being compressed depends on which of these two kinds of compression methods are used:

If your application requires a perfect reconstruction of the original image when decompressed, use a lossless compression method to compress it. Lossless compression allows no loss of image quality.

If your application can afford to sacrifice some image quality to achieve more compact storage and faster transmission, you can use the lossy compression method, JPEG. Lossy compression can yield a greater reduction in space, but the original image cannot be perfectly reconstructed from the compressed data. While photographic images may retain good quality after being compressed and decompressed, text images may include ragged edges or artifacts.

Amount of Compression

The amount of compression possible depends on both the compression method and the content of the image.

For photographic images, more compression is possible when using lossy rather than lossless compression. Using the lossy JPEG compression method on a color photographic image can reduce the space needed to 5% of the size of the uncompressed image, with little loss of image quality. Using lossless compression on the same image on average provides a 50% reduction in space.

The amount of compression possible also depends on the content of the image. For example, a complex photographic images has much information that can be compressed, so compressing it with JPEG can greatly reduce its size. However, an image of a screen dump has less information that can be compressed, so compressing it may not greatly reduce its size.

The speed of compression must also be weighed against other system performance factors. For instance, simply converting an RGB or YCbCr image to a palette may display faster remotely because there is one third the amount of data being transferred over the network.

In some cases, using lossless compression can actually result in more space being used by the image. For example, using a lossless compression method on a complicated photographic image could increase the space occupied by the image. This example underscores the need for experimentation.

Speed of Compression

The speed of image compression and decompression depends on various factors such as the type of file, system hardware, and compression method. In general, Packbits compression is a good choice for fast decompression. However, experimentation might show only a 10 to 20% faster display of an image compressed by Packbits versus a much smaller copy of the image compressed by JPEG.

The following sections provide further details on the specific compression and decompression methods.

CCITT Group 3 and 4 (FAX)

You can compress bitonal images using the CCITT Group 3 (FAX one-dimensional coding scheme) and decompress CCITT Group 3 and 4 bitonal images. FAX is the more common name for the CCITT Group 3 and Group 4 standard for document transmission; however, most FAX machines support only Group 3 format. FAX is a lossless method.

An application can compress bitonal images into FAX format, store FAX images as TIFF 5.0 files, and decompress and scale FAX images for display on windows.

CCITT provides good compression for scanned documents, where plentiful white space exists and decompresses in a reasonable amount of time. CCITT compression of photographic images is less effective.

LZW

You can compress and decompress any type of TIFF image of any bit depth using LZW, a lossless method. The application can store the compressed image in a TIFF 5.0 file or keep it in memory. An average 2:1 compression ratio is achieved with LZW compression on typical photographic images.

For a full description of the Lempel-Ziv and Welch (LZW) method refer to A Technique for High Performance Data Compression, by Terry A. Welch, IEEE Computer, vol. 17 no. 6 (June 1984).

Packbits

You can compress and decompress gray scale, palette, and bitonal images using Packbits, a lossless method. Packbits is fast, widely-supported, and provides good compression of sparse images, such as scanned documents. The application can store the compressed image in a TIFF 5.0 file or keep it in memory.

While providing less compression than LZW, Packbits-compressed files are more common than LZW-compressed files on all systems. Therefore, Packbits is a logical compression method for files you may send to various systems. On all systems, LZW-compressed files are the next most common compressed files after Packbits-compressed files.

JPEG

You can compress and decompress gray scale, RGB and YCbCr images using the Joint Photographic Expert Group (JPEG) compression method, a lossy method based on the Discrete Cosine Transform (DCT).

Using JPEG, you have a number of options for choosing between image quality and the amount of compression. You also have options for storing compressed JPEG images in TIFF files or keeping them in memory. If your application omits these options, default values are used.

The compression factor, which is also called the quantization factor, is selectable. The more compression you apply, the more information you lose. However, for photographic images, you may notice no change until you begin compressing beyond a factor of 20 times.

Before compressing a color image file with JPEG, you can save additional space by first converting the file to YCbCr format and subsampling it. Subsampling reduces the color information to be compressed, without much visible change in the image quality.

Free software for change compression in TIFF file:

C:\>C:\image2pdf_emf2pdf_cmd3.2\tiffcp.exe
Copyright (c) 2000-2006 VeryPDF.com, Inc.

usage: tiffcp [options] input... output
where options are:
 -a             append to output instead of overwriting
 -o offset      set initial directory offset
 -p contig      pack samples contiguously (e.g. RGBRGB...)
 -p separate    store samples separately (e.g. RRR...GGG...BBB...)
 -s             write output in strips
 -t             write output in tiles
 -i             ignore read errors
 -b file[,#]    bias (dark) monochrome image to be subtracted from all others
 -,=%           use % rather than , to separate image #'s (per Note below)

 -r #           make each strip have no more than # rows
 -w #           set output tile width (pixels)
 -l #           set output tile length (pixels)

 -f lsb2msb     force lsb-to-msb FillOrder for output
 -f msb2lsb     force msb-to-lsb FillOrder for output

 -c lzw[:opts]  compress output with Lempel-Ziv & Welch encoding
 -c zip[:opts]  compress output with deflate encoding
 -c jpeg[:opts] compress output with JPEG encoding
 -c packbits    compress output with packbits encoding
 -c g3[:opts]   compress output with CCITT Group 3 encoding
 -c g4          compress output with CCITT Group 4 encoding
 -c none        use no compression algorithm on output

Group 3 options:
 1d             use default CCITT Group 3 1D-encoding
 2d             use optional CCITT Group 3 2D-encoding
 fill           byte-align EOL codes
For example, -c g3:2d:fill to get G3-2D-encoded data with byte-aligned EOLs

JPEG options:
 #              set compression quality level (0-100, default 75)
 r              output color image as RGB rather than YCbCr
For example, -c jpeg:r:50 to get JPEG-encoded RGB data with 50% comp. quality

LZW and deflate options:
 #              set predictor value
For example, -c lzw:2 to get LZW-encoded data with horizontal differencing

Note that input filenames may be of the form filename,x,y,z
where x, y, and z specify image numbers in the filename to copy.
example:  tiffcp -c none -b esp.tif,1 esp.tif,0 test.tif
  subtract 2nd image in esp.tif from 1st yielding uncompressed result test.tif
Free tiffcp.exe can be downloaded from following URL:
http://www.verypdf.com/tif2pdf/image2pdf_emf2pdf_cmd.zip

Metafile/EMF/WMF/RTF To PDF Command Line User Manual:
http://www.verypdf.com/pdfcamp/rtf2pdf.html


Home | Products | Downloads | Support | Links | Contact

Copyright © 2000- VeryPDF.com, Inc. All rights reserved.
Send comments about this site to the webmaster.