A class of techniques for shrinking the size of a data file to reduce its storage requirement, by processing the data it contains using some suitably reversible algorithm. Compression methods tend to be more effective for a particular kind of data, so that text files will typically be compressed using a different algorithm from graphics or sound files.
For example RUN-LENGTH EN-CODING is very effective for compressing flat-shaded computer graphics, which contain many long runs of identical PIXEL values, but is quite poor for compressing tonally rich photographic material where adjacent pixels are different. Dictionary-based algorithms such as LEMPELZIV COMPRESSION are very effective for compressing text, but perform poorly on binary data such as pictures or sound.
Compression may be applied automatically by an operating system or application, or applied manually using a utility program such as PKZIP, TAR, LHA or STUFFITS.