How can I achieve the maximum zip compression?

0

I would like to make a "standard" zip file which contain .jpg images. Which software and switches / options should I use to achieve the maximum compression ratio? I mean maybe I can make a solid archive with some special compression options and high memory usage with 7zip.

Konstantin

Posted 2014-06-30T18:16:18.927

Reputation: 515

Question was closed 2014-07-02T14:58:07.633

9jpegs are typically highly compressed with lossy compression already. You almost certainly can't get any significant additional compression with any lossless compression algorithms. – ChrisInEdmonton – 2014-06-30T18:25:57.117

Yes, I know, but I am curious which switches and options can I use. For example -mx=9 -mpass=15 etc. Mabye even more exist. – Konstantin – 2014-06-30T18:58:06.313

On jpegs? No switches will prove generally useful. – ChrisInEdmonton – 2014-06-30T19:02:21.763

1Undestand that when you attempt to compress an already well-compressed file the "compressed" image is actually larger than the original. A fellow named Shannon made that the law, and everyone's been afraid to break it since. – Daniel R Hicks – 2014-06-30T19:07:10.797

Answers

1

As jpeg files are already compressed, you could tell zip to just store the files without trying to compress them at all. The switch --compression-method store (or -Z store or -0) will do that. But don't expect to gain anything: usually zip is smart enough to detect that compression won't help.

holgero

Posted 2014-06-30T18:16:18.927

Reputation: 201

0

As ChrisInEdmonton mentioned correctly, JPEG files are highly compressed. Compressing them with another utility will not render any significant size reduction.

However, It is possible to "recompress" JPEG files, because there are better (in terms of size) compression algorithms than the one used in JPEG. According to MaximumCompression, this is done by decoding the image back to the DCT coefficients and recompressing them with a much better algorithm then default Huffman coding (the compression algorithm JPEG uses).

Technicalities aside, the benchmark I mentioned does point out 4 compressors capable of effectively compressing a JPEG file. They are:

  • PAQ8PX with -7
  • STUFFIT 14 with Auto filetype
  • PackJPG 2.5
  • WINZIP 14 with Best Method

As far as I'm aware of, only Winzip provides both a commonly used archive format (.zip) and a decent (considering the compressibility of JPEG files) compression ratio of around 18 %. While PAQ8PX does achieve the top compression ratio (24.37 %), besides not being well known, it will most likely take a significant amount of time to compress the file.

Doktoro Reichard

Posted 2014-06-30T18:16:18.927

Reputation: 4 896