1

I want to compress a compressed file. But when I mixin the compressed file and compress it again, the file is larger than before everytime.

I have 2 methods for mixing. First, compressed file XOR another file(Generated). Second, Swap some bits in compressed file.

Do you have any ideas about new methods or is it impossible ?

Geylani ARCA
  • 308
  • 1
  • 11
  • [How many times can a file be compressed?](http://stackoverflow.com/questions/1166385/how-many-times-can-a-file-be-compressed) That should pretty much answer your question. – Bernhard Barker Sep 14 '15 at 15:22
  • I mean It's not that how many times will be compression, when I compress the compressed file again, how I can combine the compressed file to get the smaller size of file ? – Geylani ARCA Sep 14 '15 at 15:41
  • Swap some bits in compressed file: Yes, why don't you sort the bits of the compressed file (first all 0s, then all 1s)? Then, you _just_ have to store how many zeroes and how many ones you have. That will need very very little data. (It's only a joke of course.) – Thomas Mueller Sep 15 '15 at 06:46

1 Answers1

0

As mentioned in the comments, the first compression has already taken the extra "air" out so it cannot be "squeezed" smaller anymore. It is now close to random data, and compressing random data will always make it at least slightly larger due to compression headers.

The situation is different with lossy compression though, you can discard as much data as you wish.

NikoNyrh
  • 3,578
  • 2
  • 18
  • 32