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
53
votes
11 answers

Create normal zip file programmatically

I have seen many tutorials on how to compress a single file in c#. But I need to be able to create a normal *.zip file out of more than just one file. Is there anything in .NET that can do this? What would you suggest (baring in mind I'm under…
anon271334
49
votes
6 answers

Python script for minifying CSS?

I'm looking for a simple Python script that can minify CSS as part of a web-site deployment process. (Python is the only scripting language supported on the server and full-blown parsers like CSS Utils are overkill for this project). Basically I'd…
Will Moffat
  • 1,009
  • 1
  • 9
  • 11
49
votes
1 answer

How does tinypng.org compress PNG files?

http://tinypng.org/ is a great service, they optimized my png images by ~67%. How does their service work? How can they minimize size and quality of pictures still remains the same?
good_evening
  • 21,085
  • 65
  • 193
  • 298
48
votes
7 answers

Does AES (128 or 256) encryption expand the data? If so, by how much?

I would like to add AES encryption to a software product, but am concerned by increasing the size of the data. I am guessing that the data does increase in size, and then I'll have to add a compression algorithm to compensate.
Bob Kuhl
48
votes
12 answers

Reducing the file size of a very large images, without changing the image dimensions

Consider an application handling uploading of potentially very large PNG files. All uploaded files must be stored to disk for later retrieval. However, the PNG files can be up to 30 MB in size, but disk storage limitations gives a maximum per file…
knorv
  • 49,059
  • 74
  • 210
  • 294
47
votes
12 answers

Exclude debug JavaScript code during minification

I'm looking into different ways to minify my JavaScript code including the regular JSMin, Packer, and YUI solutions. I'm really interested in the new Google Closure Compiler, as it looks exceptionally powerful. I noticed that Dean Edwards packer has…
Tauren
  • 26,795
  • 42
  • 131
  • 167
47
votes
1 answer

Tools to optimize (remove redundancy and merge) CSS?

I'm searching for a good CSS compress, merge and optimization tool. I have found tools that clean the CSS but they don't optimize the overwrites. Here is a basic example: a{color:#000} and on another line the a color is overwritten with…
Lucian Povatanu
  • 609
  • 1
  • 5
  • 7
47
votes
4 answers

How to reduce the image size without losing quality in PHP

I am trying to develop an image-based web site. I am really confused about the best image type for faster page loading speeds and best compression practices. Please advise me on the best way to compress image sizes.
user1431849
  • 499
  • 1
  • 4
  • 7
46
votes
4 answers

Compression and decompression of data using zlib in Nodejs

Can someone please explain to me how the zlib library works in Nodejs? I'm fairly new to Nodejs, and I'm not yet sure how to use buffers and streams. My simple scenario is a string variable, and I want to either zip or unzip (deflate or inflate,…
Eli
  • 2,666
  • 7
  • 33
  • 37
46
votes
2 answers

How does Git save space and is fast at the same time?

I just saw the first Git tutorial at http://blip.tv/play/Aeu2CAI. How does Git store all the versions of all the files, and how can it still be more economical in space than Subversion which saves only the latest version of the code? I know this can…
Lazer
  • 90,700
  • 113
  • 281
  • 364
45
votes
5 answers

7zip Ultra LZMA2 compression

How can I convert this settings into command? Here are the results: // Manual Compression (see the image above) Compressed Size: 12,647,451 bytes // Ultra 7z a -t7z Files.7z -mx9 -aoa Compressed Size: 12,676,886 bytes // LZMA2 7z a -t7z…
fiberOptics
  • 6,955
  • 25
  • 70
  • 105
45
votes
8 answers

How can I use deflated/gzipped content with an XHR onProgress function?

I've seen a bunch of similar questions to this get asked before, but I haven't found one that describes my current problem exactly, so here goes: I have a page which loads a large (between 0.5 and 10 MB) JSON document via AJAX so that the…
Jimmy Sawczuk
  • 13,488
  • 7
  • 46
  • 60
44
votes
8 answers

How to zip multiple files using only .net api in c#

I like to zip multiple files which are being created dynamically in my web application. Those files should be zipped. For this, i dont want to use any third-party tools. just like to use .net api in c#
Partha
  • 2,062
  • 6
  • 24
  • 31
43
votes
9 answers

Disable Asset Minification in Rails Production

In order to debug javascript in my heroku production environment, I need to disable asset compression (or at least compression of javascript). I tried config.assets.compress = false along with config.assets.debug = true, and the compressed assets…
Jack R-G
  • 1,778
  • 2
  • 19
  • 25
43
votes
7 answers

Before deployment, is there tool to compress HTML class attribute and CSS selectors?

In current project, I was asked for compressing the HTML class attribute and corresponding CSS selectors before deployment. For example, the code on production is:
.foo {/*Style goes here*/} #bar…
steveyang
  • 9,178
  • 8
  • 54
  • 80