Compress all the PNG files in your Home directory

Nov 23, '11 07:30:00AM

Contributed by: wiesmann

PNG image files are often not compressed with the optimal compression setting, however a one line command can fix this (and save some space).

Basically, one just needs to have MacPorts and the optipng port installed, and run the following command:

mdfind -0 -onlyin ~ "kMDItemContentType=public.png" | xargs -n 5 -0 optipng -preserve
For more details, see this blog entry.

[crarko adds: I haven't tested this one. Note that to use MacPorts you also need to have Xcode installed to compile the ports. If you already have MacPorts set up give this hint a try and let us know how efficient the compression is for you.]

Comments (3)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20111122135810992