There are two types of Data Compression :
1. Lossy Compression
It is also known as perceptual coding.
When we apply data compression to a message, the message may not be recovered exactly as it was before the compression.
This type of data compression is used only when lossis acceptable.
This type of compression is ideal to achieve higher compression.
It is not preferable for critical data like textual data. It is most useful for Digitally Sampled Analog Data (DSAD).
DSAD generally consists sound, video, graphics or picture files.
For example, in a sound file there can be very high and low frequencies, which the human ear cannot hear, may be truncated from file.
A picture created in MS-Paint can be saved with different formats like .bmp, .gif, .jpg, it occupies different space.
Different format use different techniques to store the same image.
The size of each of the format shows that as size of the picture reduces, loss of data increases.
2. Lossless Compression
In this compression, the original data can be resonstructed after transmission or after decompression.
Here the originnal data can exactly be decoded.
It works by finding repeated patterns in a message and encoding those patterns in an efficient manner.
So Lossless data compression is also reffered to as 'redundancy Reduction'.
This type of compression may not work well on random messages, as it is dependent on the patterns in the message. Lossless data compression is ideal for textual information.