Hacker News new | past | comments | ask | show | jobs | submit login

Great write up and +1 kudos to author for diving into the details.

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/




The coolest aspect of this article IMO was that Gimp's output (with the right options selected) was already the minimum size for a transparent 1x1 gif.

He 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).


For Linux, Trimage does the same thing as ImageOptim, plus it works on the command line:

http://trimage.org/


Worth mentioning as well is TinyPNG - http://tinypng.org/, a free web service that uses lossy compression to shrink PNG images.


If you want it locally: http://pngnq.sourceforge.net/

I think the service simply uses that program behind the scenes.


No, they use their own tech. It uses some pre-existing algorithms but it's currently not available for offline use.


http://news.ycombinator.com/item?id=4167964 (by molf, apparently someone involved in creating TinyPNG)

   > 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:

http://news.ycombinator.com/item?id=4167964


Interesting read, thanks.


TinyPNG uses http://pngquant.org and optipng.


It's a bit more than that, I know advpng is also used somewhere in the process.


In my tests, it's lossy, but it's just barely lossy. Keep your original and deploy this version on your site.

I just wish they had an API/offline utility.


While I didn't see any public mention of it, you can use

  curl --data-binary @your-file.png http://tinypng.org/api/shrink


That's fantastic, thanks. I wonder if they'd mind me creating a batch tool for personal use...


Just to add... for PNG optimisations on Windows.

* PNGGauntlet - http://pnggauntlet.com/ - Combines PNGOUT, OptiPNG, and DeflOpt.


If you're desperate to save space (or creating thumbnails), Windows/C# devs can lossily cut down PNGs to 256 color/8-bit using nQuant http://nquant.codeplex.com/

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 did a few tests some time ago and to obtain tiniest possible images on majority of files I have to do following sequences

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!


http://davidcrowell.com/jstrip

jscl.exe -d -j -n -r -s ¤.jp¤

Instantly gets rid of more jpg junk.

Edit: replace asterixes with ¤


Pngcrush is a great alternative.. and so is smushit - http://www.smushit.com/ysmush.it/


For PNGs, I have yet to come across a tool that would beat PNGOUT.


ImageOptim is essentially a wrapper for, among other tools, PNGOUT.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: