Raster data is the color of pixels stored on a hard drive. Each pixel is given a color number, and these numbers are stored in a matrix of columns and rows, called a raster.
The amount of raster data stored can be large for high-resolution images. When you store more pixels, you need more disk space and memory. Data compression schemes are often used to cope with the demands placed on storage and memory systems. Compression algorithms look for patterns in the data (recognized by repetition or similarity) and can more efficiently represent patterns in a file as compared with the raw, uncompressed data. Furthermore, compression schemes fall into two categories: lossless and lossy. Lossless compression preserves 100% of the original data, whereas lossy compression is a trade-off between much smaller file sizes and degraded data.
Consequently, many file formats have arisen over time that deal with the compression issue in different ways. For example, the Windows bitmap (.bmp) format is uncompressed and therefore takes a large amount of memory and disk space. An example of lossless compression is the Lemple-Zif-Welch (LZW) method used in the Tagged Image File Format (.tif). The Joint Photographic Experts Group (.jpg) format is lossy; it was designed to greatly reduce the size of photographic images, but the trade-off is reduced quality. You will learn how to prepare and optimize compressed images for the Web in Chapter 9, "Showing Your Clients."
Was this article helpful?