Features in common:
- A compression algorithm is used
- The purpose is to reduce the size of data/files
- Less storage capacity will be needed to store the data/files
- Less time it will takes to transfer the data/file
Differences:
Lossy:
- some data will be removed
- the original data/file can not be restored after decompression
- usually much smaller size of data/file can be produced
- usually used to compress image, sound, video
- the quality of image/sound would be reduced.
- Perceptual shaping is used.
Lossless:
- not data lost
- the data/files after decompression are exactly the same as the original
- usually used to compress text, data sheet
More details about lossy compression of images and sound
Lossy compression of images:
- color depth can be reduced
- image resolution can be reduced
- image can be cropped.
- Number of colors can be reduced
Lossy compression of sound:
- Sample rate can be reduced
- Bit depth/sample resolution can be reduced
- Sound that can not be detected by human ears can be removed