The Tiniest GIF Ever
probablyprogramming.com
probablyprogramming.com
For the mere mortals out there looking to make their GIF, JPEG, and PNG images smaller (and websites faster), I highly recommend ImageOptim (http://imageoptim.com/). This Mac-only tool combines all of the libraries below to compress your images down to the (nearly if not the) smallest, cross-system compatible size.
If you're Mac based, try this:
* ImageOptim http://imageoptim.com/
If you're Linux based, try these:
* PNGOut - http://www.advsys.net/ken/util/pngout.htm
* advpng - http://advancemame.sourceforge.net/doc-advpng.html
* pngcrush - http://pmt.sourceforge.net/pngcrush/
* optipng - http://optipng.sourceforge.net/
* jpegoptim - http://www.kokkonen.net/tjko/projects.html
* gifsicle - http://www.lcdf.org/gifsicle/
* PNGGauntlet - http://pnggauntlet.com/ - Combines PNGOUT, OptiPNG, and DeflOpt.
Matt Wrock documented the creation of the tool, including details on the approaches taken by tools like OptiPNG: http://www.mattwrock.com/post/2011/09/05/Convert-32-bit-PNGs...
I think the service simply uses that program behind the scenes.
> Mostly pngquant (the new version), optipng and
> advpng. We are still tuning parameters and
> swapping in and out tools based on our benchmarks
> and testing suite.
from their debut on HN back in June, where they caught a lot of flack for being a web service:I just wish they had an API/offline utility.
curl --data-binary @your-file.png http://tinypng.org/api/shrinkHe succeeded in trimming only 6 bytes off of that before he abandoned transparency and that was at the cost of getting errors in some programs with the result (no thanks).
PNG: advpng -z4, optipng -o7, advdef -z4
JPG: jpegtran -copy none, jpegrescan (that also uses jpegtran)
GIF: gifsicle -O3
They are quite time consuming (especially in case of PNG), but if you know any better sequences, please let me know!
jscl.exe -d -j -n -r -s ¤.jp¤
Instantly gets rid of more jpg junk.
Edit: replace asterixes with ¤
But won't there always exist a few people who just happen to have a talent or obssesion for the details? What name do we give those people? The word "hacker" is taken, and has a more impish, generalist connotation. "Engineer" has way too formal baggage associated. We need another word that means about the same thing as "docent", I reckon.
The peculiarity in this example is, that the image's content is the whole tiff itself.
Some people, especially mobile users concerned with bandwidth, might have images turned off but CSS turned on. I had icons for some buttons, sprited and set as CSS backgrounds. Inside the same element I put an img tag with a minimal gif and an alt text with a fallback (a text label, or a single unicode character). The invisible image would be shown for users images, and the alt text for users without images.
http://timelessname.com/elfbin
I love posts like this.
It could also be re-using a drawing surface of some sort.
If that's not right, maybe it's supplying a color table randomly-generated on the fly, but I doubt it's just random memory -- can any random bytes really make up a valid color table? If it were random memory I'd expect crashes or errors, not varying colors.
It's a programming error if they assume the earlier code found an (optional) color table; that's it.
I didn't know the color table was formatted -- kinda obviously, it's just a 3-byte chunk per color, though (i.e., 00ffaa) so any bytes in there will be valid colors... so my original idea that random memory would crash things (by providing an invalid color table) was wrong.
<svg xmlns="http://www.w3.org/2000/svg"/>