Questions tagged [compression]

The name given to the process of encoding data such that it uses lesser number of bits as compared to the original representation.

There are a number of techniques to compress information, with most algorithms working to compress image, speech, music or video. Encoding the same information in lesser bits results in saving some crucial resource such as transmission bandwidth or hard-disk space. Compression algorithms also take advantage of human perception to further reduce the size of information. By encoding the same piece of information with fewer bits in places that the human brain is not accustomed to perceiving as well as other parts, substantial gains in compression ratios can be achieved.

9175 questions
1192
votes
3 answers

How are zlib, gzip and zip related? What do they have in common and how are they different?

The compression algorithm used in zlib is essentially the same as that in gzip and zip. What are gzip and zip? How are they different and how are they same?
Abhishek Jain
  • 9,614
  • 5
  • 26
  • 40
597
votes
15 answers

Twitter image encoding challenge

If a picture's worth 1000 words, how much of a picture can you fit in 140 characters? Note: That's it folks! Bounty deadline is here, and after some tough deliberation, I have decided that Boojum's entry just barely edged out Sam Hocevar's. I will…
Brian Campbell
  • 322,767
  • 57
  • 360
  • 340
437
votes
17 answers

Tool to Unminify / Decompress JavaScript

Are there any command line scripts and/or online tools that can reverse the effects of minification similar to how Tidy can clean up horrific HTML? (I'm specifically looking to unminify a minified JavaScript file, so variable renaming might still be…
Andy Ford
  • 8,410
  • 3
  • 26
  • 36
280
votes
9 answers

What is a good Java library to zip/unzip files?

I looked at the default Zip library that comes with the JDK and the Apache compression libs and I am unhappy with them for 3 reasons: They are bloated and have bad API design. I have to write 50 lines of boiler plate byte array output, zip input,…
pathikrit
  • 32,469
  • 37
  • 142
  • 221
266
votes
1 answer

What is the difference between tar and zip?

What is the difference between tar and zip? What are the use cases for each?
mtk
  • 13,221
  • 16
  • 72
  • 112
245
votes
12 answers

Creating a ZIP archive in memory using System.IO.Compression

I'm trying to create a ZIP archive with a simple demo text file using a MemoryStream as follows: using (var memoryStream = new MemoryStream()) using (var archive = new ZipArchive(memoryStream , ZipArchiveMode.Create)) { var demoFile =…
Marius Schulz
  • 15,976
  • 12
  • 63
  • 97
230
votes
10 answers

Enable IIS7 gzip

How can I enable IIS7 to gzip static files like js and css and how can I test if IIS7 is really gziping them before sending to the client?
Paulo
  • 7,123
  • 10
  • 37
  • 34
221
votes
7 answers

Create a tar.xz in one command

I am trying to create a .tar.xz compressed archive in one command. What is the specific syntax for that? I have tried tar cf - file | xz file.tar.xz, but that does not work.
George K.
  • 2,867
  • 4
  • 19
  • 28
218
votes
9 answers

Why use deflate instead of gzip for text files served by Apache?

What advantages do either method offer for html, css and javascript files served by a LAMP server. Are there better alternatives? The server provides information to a map application using Json, so a high volume of small files. See also Is there any…
Ken
  • 77,016
  • 30
  • 84
  • 101
215
votes
9 answers

JavaScript implementation of Gzip

I'm writing a Web application that needs to store JSON data in a small, fixed-size server-side cache via AJAX (think: Opensocial quotas). I do not have control over the server. I need to reduce the size of the stored data to stay within a…
David Citron
  • 43,219
  • 21
  • 62
  • 72
205
votes
8 answers

How can I tell if my server is serving GZipped content?

I have a webapp on a NGinx server. I set gzip on in the conf file and now I'm trying to see if it works. YSlow says it's not, but 5 out of 6 websites that do the test say it is. How can I get a definite answer on this and why is there a difference…
Johnny
  • 7,073
  • 9
  • 46
  • 72
199
votes
8 answers

How do I ZIP a file in C#, using no 3rd-party APIs?

I'm pretty sure this is not a duplicate so bear with me for just a minute. How can I programatically (C#) ZIP a file (in Windows) without using any third party libraries? I need a native windows call or something like that; I really dislike the idea…
Esteban Araya
  • 29,284
  • 24
  • 107
  • 141
187
votes
8 answers

Compression/Decompression string with C#

I am newbie in .net. I am doing compression and decompression string in C#. There is a XML and I am converting in string and after that I am doing compression and decompression.There is no compilation error in my code except when I decompression my…
Mohit Kumar
  • 2,019
  • 2
  • 17
  • 14
174
votes
13 answers

Best JavaScript compressor

What is the the best JavaScript compressor available? I'm looking for a tool that: is easy to use has a high compression rate Produce reliable end results (doesn't mess up the code)
Ron Harlev
  • 16,227
  • 24
  • 89
  • 132
173
votes
10 answers

How to create full compressed tar file using Python?

How can I create a .tar.gz file with compression in Python?
shahjapan
  • 13,637
  • 22
  • 74
  • 104
1
2 3
99 100