Sunday, May 11, 2008

What is image compression?

Image compression is defined as minimizing the size in bytes of a graphics file without degrading the quality of the image to an unacceptable level. Image compression allows more images to be stored in a given amount of disk or memory space. It is therefore common to apply compression to bitmapped images, in order to reduce the amount of storage they require. Image compression also reduces the time required for images to be sent over the Internet or downloaded from Web pages.
The effectiveness of an algorithm in compressing a file is measured by the compression ratio it achieves, so an algorithm that managed to squeeze a 4 by 3 inch image down to 9kb would have achieved a compression ratio of just over 20. Compression algorithms are broadly divided into two categories:
Lossless Compression
Lossy Compression

Lossless Compression: Lossless compression algorithms reduce the amount of information by rearranging the data, representing it more efficiently and removing redundancy. However there is no loss of data. All the bits of data that were present in the original image are recovered when the image is decompressed. These algorithms have higher compression ratios but may introduce some distortion in the compressed image. Lossless Compression is preferred for text or spreadsheet files where loss of data could pose problems.
Lossless algorithms rearrange the data, representing it in a more efficient way and removing redundancy, but they do not discard any data. Although lossless compression algorithms can be applied to data of any sort, including images, but the degree of compression that can be achieved losslessly is limited. With lossless compression, every single bit of data that was originally in the file remains after the file is uncompressed. All of the information is completely restored. This is generally the technique of choice for text or spreadsheet files, where losing words or financial data could pose a problem.
The Graphics Interchange File (GIF) and the zip convention used in programs like WinZip are some image formats used on the Web that provide lossless compression.
GIF is a popular format for Web images. It uses the lossless Lempel Ziv Welch (LZW) algorithm. GIF format is suitable for compression of images with large areas of the same color, like company logos, line drawings like charts and icons. It is also good for animation files.The Portable Network Graphic (PNG) is another lossless format that supports a more efficient compression algorithm than GIF and has a better compression ratio. PNG is good for images with blended, transparent backgrounds.
Lossy Compression: Lossy compression algorithms achieve higher compression ratios by throwing away the relatively unimportant data that is not well perceived by the human eye. Lossy compression reduces a file by permanently eliminating certain information. When the file is uncompressed, only a part of the original information is still there. However, the loss is such that it will not be perceived by the human eye. Lossy compression is generally used for continuous color images, video and sound.
The compression ratios achievable through lossy compression are much better than those achieved with lossless compression algorithms.
The Joint Photographic Experts Group (JPEG) format commonly used for photographs and other complex still images on the Web uses a lossy compression algorithm. Using JPEG compression, the creator can decide how much loss to introduce and make a trade-off between file size and image quality.
The Moving Pictures Experts Group (MPEG) format for video files and the MPEG Layer 3 (MP3) format for audio files also use lossy compression algorithms to achieve compression.

1 comment:

Unknown said...

Hi Rakhi,
perhaps you should try Image Compressor 2008 for your compression needs.
JPEG is definetly the industry standard. And Image Compressor creates the best JPEG possible.