This article is a primer on the basic types of data compression, with an introductory explanation of the mathematics and algorithms that go into compression techniques. Brief consideration and examples are given to help you evaluate what types of compression tools and techniques are suited to your own applications. Data compression is widely used in a variety of programming contexts. All popular operating systems and programming languages have numerous tools and libraries for dealing with data compression of various sorts. But those statements are essentially just true by definition.
Redundancy can come in a lot of different forms.
But more often redundancies tend to come on a larger scale, either regularities of the data set taken as a whole, or sequences of varying lengths that are relatively common. If this description seems a bit complex to unpack, read on to find some more practical illustrations. This article is generally about lossless compression techniques, but it's helpful to understand the distinction first. Lossless compression involves a transformation of the representation of a data set so that it is possible to reproduce exactly the original data set by performing a decompression transformation. An advantage of lossy techniques is that they can frequently produce far more compact data representations than those of lossless compression techniques.