technovice said:
A few questions on compression tools
How do compression tools (like winrar, winzip or even divx codecs) work?
Why does the compression ratio vary from one file to another?
Which is the best general utility compression tool?
There are two types of compression:
(a) Lossless
In this type of compression, No data is lost, every thing compressed by these methods can be recovered exactly.
Examples: LZW, LZMA, winzip, gzip, bzip2, huffman, Arithmetic coding etc.
Lossless compression methods are of two types:
(1) Dictionary based
Examples: LZW, LZMA, winzip, gzip, bzip2
(2)Variable length coding
Examples:
Huffman, Arithmetic coding
(b) Lossy compression
In this type of compression, you lose some data. Here you can make a trade off between quality and size. The more compression you want, the lesser quality you get.
Examples: Jpeg, Mpeg, Mp3, Aac, Ogg, Wma, Wmv, Divx.
Lossy methods exploit the inherent characteristics of the data to compress it. Because of that, there are separate lossy methods for images, music, and movies. Compare that with a lossless method. A single lossless method (such as zip) can compress all sorts of data, unfortunately, compression is not very high in lossless methods.
Obviously, if you want to compress a program executable or important data, you have to do it with lossless methods. If you want to compress say image data, you can go for either lossless format (PNG) or a lossy format (JPG).
Note that winzip and winrar are not just compression tools, the are also archivers, that is they can compress your data, and store all the data in a single file -> archiving it.
Best tools:
Freeware: 7zip
Shareware: Winrar.
Winrar has the best lossless compression, while 7zip is a bit slower, but a close second. Winrar can produce archives in zip and rar format, with rar being the default. 7 zip can produce archives in 7z, zip, tar, tar.gz and tar.bz2 format, with 7z being the default. Last note: only 7zip can open files in 7z format, so be careful about this if you do use it.
Best lossy audio compression: OGG
Second best: Real Audio 8
*www.xiph.org/ogg/vorbis/listen.html
Best Lossy video compression: H.265
Second best: No Idea - maybe Divx or Wmv?
Best Lossy image compression: Jpeg 2000.
Unfortunately, it is so patent encumbered, nobody uses it.
Second best: Jpeg.
Enjoy!
Pallav