compression

How do I output compressed CSS from Compass?

余生颓废 提交于 2019-12-02 17:39:44
How do I configure compass to output smaller or compressed CSS files? I tried compass -s compressed but that didn't work. Rob Wilkerson In your config.rb file: output_style = :compressed More at http://compass-style.org/help/documentation/configuration-reference/ . Did you try with the full name of the argument in command line ? compass watch --output-style=compressed i use the following terminal command compass compile -e production --force reference: http://compass-style.org/help/tutorials/production-css/ 来源: https://stackoverflow.com/questions/2335920/how-do-i-output-compressed-css-from

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

醉酒当歌 提交于 2019-12-02 17:05:10
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 size of 1 MB. The problem is to take an input PNG of file size up to 30 MB and produce an output PNG of file size below 1 MB. This operation will obviously be lossy - and reduction in image quality, colors, etc is not a problem. However, one thing that must not be changed is the image dimension. Hence, an input file of dimension 800x600 must produce

What is the best file compression of random binary data that you can achieve? [closed]

隐身守侯 提交于 2019-12-02 17:02:55
Specifically, what programs are out there and what has the highest compression ratio? I tried Googling it, but it seems experience would trump search results, so I ask. If file sizes could be specified accurate to the bit, for any file size N, there would be precisely 2^(N+1)-1 possible files of N bits or smaller. In order for a file of size X to be mapped to some smaller size Y, some file of size Y or smaller must be mapped to a file of size X or larger. The only way lossless compression can work is if some possible files can be identified as being more probable than others; in that scenario,

Run-length decompression

最后都变了- 提交于 2019-12-02 17:02:11
问题 CS student here. I want to write a program that will decompress a string that has been encoded according to a modified form of run-length encoding (which I've already written code for). For instance, if a string contains 'bba10' it would decompress to 'bbaaaaaaaaaa'. How do I get the program to recognize that part of the string ('10') is an integer? Thanks for reading! 回答1: A simple regex will do. final Matcher m = Pattern.compile("(\\D)(\\d+)").matcher(input); final StringBuffer b = new

Excluding directory when creating a .tar.gz file

倖福魔咒の 提交于 2019-12-02 15:42:10
I have a /public_html/ folder, in that folder there's a /tmp/ folder that has like 70gb of files I don't really need. Now I am trying to create a .tar.gz of /public_html/ excluding /tmp/ This is the command I ran: tar -pczf MyBackup.tar.gz /home/user/public_html/ --exclude "/home/user/public_html/tmp/" The tar is still being created, and by doing an ls -sh I can see that MyBackup.tar.gz already has about 30gb, and I know for sure that /public_html/ without /tmp/ doesn't have more than 1GB of files. What did I do wrong? Try removing the last / at the end of the directory path to exclude tar

What is the current state of text-only compression algorithms?

亡梦爱人 提交于 2019-12-02 15:34:37
In honor of the Hutter Prize , what are the top algorithms (and a quick description of each) for text compression? Note: The intent of this question is to get a description of compression algorithms, not of compression programs. Corbin March The boundary-pushing compressors combine algorithms for insane results. Common algorithms include: The Burrows-Wheeler Transform and here - shuffle characters (or other bit blocks) with a predictable algorithm to increase repeated blocks which makes the source easier to compress. Decompression occurs as normal and the result is un-shuffled with the reverse

How does tinypng.org compress PNG files? [closed]

廉价感情. 提交于 2019-12-02 15:29:12
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? The answer's right on that web page: When you upload a PNG (Portable Network Graphics) file, similar colours in your image are combined. This technique is called “quantisation”. Because the number of colours is reduced, 24-bit PNG files can be converted to much smaller 8-bit indexed colour images. All unnecessary metadata is stripped too. The result: tiny 8-bit PNG files with 100% support for transparency. Have

Suggested Compression Ratio with H.264?

末鹿安然 提交于 2019-12-02 14:06:52
Note bene: I realize this is an immensely complicated question with about a million levels of nuance that I'm trying to reduce to a single number... I'm about to undertake a large video encoding project using H.264 encoding. We are trying to create multiple bitrate profiles in order to accommodate streaming across internet connections, processors, devices, etc. Generally speaking, what kind of compression ratio should I be expecting to see (while staying within a reasonable level of quality)? For example, a 640x360 (16:9) pixel video file @ 24 frames per second and 16-bit color should yield an

Create a tar.xz in one command

别等时光非礼了梦想. 提交于 2019-12-02 13:54:48
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. Use the -J compression option for xz . And remember to man tar :) tar cfJ <archive.tar.xz> <files> Edit 2015-08-10: If you're passing the arguments to tar with dashes (ex: tar -cf as opposed to tar cf ), then the -f option must come last , since it specifies the filename (thanks to @A-B-B for pointing that out!). In that case, the command looks like: tar -cJf <archive.tar.xz> <files> Switch -J only works on newer systems.

JavaScript compression

假装没事ソ 提交于 2019-12-02 12:50:50
I look for tool which can compress JavaScript source code. I found some web tools which only deletes whitespace chars? But maybe exist better tool which can compress user's function names, field name, deletes unused fields, others. A tool often used to compress JS code is the YUI Compressor . Considering there is this option : --nomunge Minify only. Do not obfuscate local symbols. It should be able to do what you asked. And here is an article about it : Introducing the YUI Compressor . Quoting that article : It starts by analyzing the source JavaScript file to understand how it is structured.