Lossless compression “packs data” into a smaller file size by using a kind of internal shorthand to signify redundant data. If an original file is 1.5MB (megabytes), lossless compression can reduce it to about half that size, depending on the type of file being compressed. This makes it convenient for transferring files across the Internet, as smaller files transfer faster. This process is also handy for storing files as they take up less room.
The zip convention, used in programs like WinZip, uses lossless compression. For this reason zip software is popular for compressing program and data files. That’s because when these files are decompressed, all bytes must be present to ensure their integrity. If bytes are missing from a program, it won’t run. If bytes are missing from a data file, it will be incomplete and garbled. GIF image files also use lossless compression.
Lossless compression has advantages and disadvantages. The advantage is that the compressed file will decompress to an exact duplicate of the original file, mirroring its quality. The disadvantage is that the compression ratio is not all that high, precisely because no data is lost.
To get a higher compression ratio — to reduce a file significantly beyond 50% — you must use lossy compression. Lossy compression will strip a file of some of its redundant data. Because of this data loss, only certain applications are fit for lossy compression, like graphics, audio, and video. Lossy compression necessarily reduces the quality of the file to arrive at the resulting highly compressed size, but depending on the need, the loss may acceptable and even unnoticeable in some cases.
JPEG uses lossy compression, which is why converting a GIF file to JPEG will reduce it in size. It will also reduce the quality to some extent.
Lossless and lossy compression have become part of our every day vocabulary largely due to the popularity of MP3 music files. A standard sound file in WAV format, converted to a MP3 file will lose much data as MP3 employs a lossy, high-compression algorithm that tosses much of the data out. This makes the resulting file much smaller so that several dozen MP3 files can fit, for example, on a single compact disk, verses a handful of WAV files. However the sound quality of the MP3 file will be slightly lower than the original WAV, noticeably so to some.
As always, whether compressing video, graphics or audio, the ideal is to balance the high quality of lossless compression against the convenience of lossy compression. Choosing the right lossy convention is a matter of personal choice and good results depend heavily on the quality of the original file.