QuickTime: Image Compression Details

Apple supports all compression schemes through QuickTime's Component Manager and Image Compression Manager services.

Here is a brief overview of compression characteristics and the initial Apple-supplied compressors.
Characteristics
---------------
There are four main characteristics of image compression algorithms:

- Compression ratio
- Image quality
- Compression/ decompression speed
- Spatial/temporal compression

Compression Ratio
-----------------
The compression ratio is equal to the size of the original image divided by the size of the compressed image. This ratio gives an indication of how much compression is achieved for a particular image. Most algorithms have a typical range of compression ratios that they can achieve over a variety of images. Because of this, it is usually more useful to look at an average compression ratio for a particular method.

The compression ratio typically affects the picture quality. Generally, the higher the compression ratio, the poorer the quality of the resulting image. The tradeoff between compression ratio and picture quality is an important one to consider when compressing images.

Furthermore, some compression schemes produce compression ratios that are highly dependent on the image content. For example, a highly detailed image of a crowd at a football game may produce a very small compression ratio, whereas an image of a pure blue sky may produce a very high compression ratio.

Image Quality
-------------
Compression schemes can be lossy or lossless. Lossless schemes preserve the original data. Lossy schemes don't preserve all the original data; you can't recover lost picture information after compression. Lossy schemes attempt to remove picture information the viewer won't notice. As more and more picture information is removed, the picture quality decreases.

Compression/Decompression Speed
-------------------------------
Compression and decompression time is defined as the amount of time required to encode and decode a picture, respectively.

Compression/decompression speed depends on:

- The complexity of the compression algorithm
- The efficiency of the implementation of the algorithm
- The speed of the processor hardware

Generally, the faster that both operations can be performed, the better. Fast compression time speeds up the material creation. Fast decompression time speeds up display and user interaction with images.

Spatial and Temporal Compression
--------------------------------
Spatial compression removes information from within a single still image. Temporal compression removes information between frames.

Apple-Supplied Compressors
--------------------------
Apple supplies a basic set of three image compression algorithms for the first release of QuickTime:

- The Photo Compressor
- The Animation Compressor
- The Video Compressor

It's important to note that these compressors represent only a portion of Apple's overall compression strategy, which includes both hardware and software-based schemes. Software-based video compression provides users with a starting point that meets the minimum requirements of many applications while allowing room for additional schemes.

The following paragraphs discuss each of these compressors in greater detail.

Photo Compressor
----------------
The Photo Compressor implements the Joint Photographic Experts Group (JPEG) algorithm for image compression. JPEG is an international standard for compressing still images. The technique is based on the use of the Discrete Cosine Transform (DCT). The version of JPEG supplied with QuickTime complies with the ISO baseline standard.

The general character of DCT-based compression schemes is that they perform best on images that vary smoothly, or that don't have a large percentage of their areas devoted to edges or other sharp detail. Most natural images fall into this category. For such 24 bits per pixel images, the Photo Compressor will produce a reconstructed image which is visually indistinguishable from the original at a compression ratio of 10:1. In practice, you will find that compression ratios are highly dependent on image content, but generally range from 5:1 to 100:1, with excellent picture quality resulting from compression ratios between 10:1 and 20:1. Compression time is equal (or very nearly equal) to decompression time.

On a Macintosh IIcx, it takes approximately 10 seconds to decompress images at 640 x 480 pixel resolution. The compression speed scales with CPU performance, so on a Macintosh IIfx, the same operation would require approximately 4 seconds. Photo quality is generally very good to exceptional and is often sufficient for use in demanding desktop publishing applications. Very high resolution images obtained through the use of 24-bit color scanners would best be compressed using the Photo Compressor.

Animation Compressor
--------------------
Apple developed the Animation Compressor algorithm, based on run-length encoding techniques. This algorithm is best suited to animation and computer generated content. In addition, the Animation Compressor can compress sequences of screen-recorded images, such as those created by Farallon's ScreenRecorder product.

Like any QuickTime compressor, the Animation Compressor can compress input video images from all bit depths (1, 2, 4, 8, 16 and 24-bit color depths), and can decompress to all bit depths.

The Animation Compressor compression method can be considered an extension of the PICT image format to the temporal domain. A PICT image is stored in run-length encoded format and is lossless. Animation Compressor is also stored in run-length encoded format. However, Animation Compressor can work a lossy or lossless mode, and can support both spatial and temporal compression. Both modes maintain picture content precisely, storing an animation as a series of run-length encoded images. The lossy mode loses some quality, storing the difference between certain frames rather than the frames themselves, but is fast enough for real-time playback.

The Animation Compressor can play back images at up to 30 frames per second at full-screen resolutions, but its performance and achieved compression ratios are highly dependent on the type of images in a scene.

Video Compressor
----------------
Apple developed the Video Compressor image compression to permit fast decompression while maintaining good picture quality. This rapid decompression also displays 24-bit still images very quickly.

The Video Compressor should generally be used for digitized video content rather than for synthetically generated images. This compressor supports both spatial and temporal compression. If you use only spatial compression, then you will obtain compression ratios from 5:1 to 8:1 with reasonably good quality. If you use both spatial and temporal compression,
the compression ratio range extends from between 5:1 to 25:1.

On a Macintosh IIcx, it takes half a second to decompress an image at full-screen resolution, and about three seconds to compress the same image. The compression speed scales with CPU performance, so on a Macintosh IIfx compressing a full-screen image requires one second, and decompress time is 1/5 second.
Published Date: Feb 18, 2012