If you liked my how-to on rolling your own ImageMagick-based OS X Services using shell scripts, you’re going to love OptiPNG. It’s another command line utility that can be used to shrink PNGs without losing any quality.
You can do this in one of two ways: the command-line way, which involves typing every time you want to use OptiPNG, or the modern way. Whichever you choose, you should grab the files from the SourceForge page, open up the resulting optipng–0.7.4.tar.gz file, and install.
This is pretty easy. The best way is to follow along with Macworld’s tutorial, or you could just follow the instructions in the read me file in the package:
cd optipng-0.7.4/
./configure
make
make test
Then you can just type
optipng filename.png
into the terminal window and your PNG will be optimized.
That’s the old-fashioned way. Instead, you could just follow along with my tutorial, and add this code into the Automator workflow before saving. (Warning: I haven’t tested this as I’m currently traveling with a machine running Mavericks, and my command-line tools are a little screwy).
for f in "$@"
do
"$@" optipng
echo "$f"
done
Save this as a Finder Service and you can right-click on any PNG to shrink it down. We still can’t use PNGs at CoM (because why would a Mac and iOS site want to post screenshots, right?), but it could be a great way to shrink down a lot of saved screenshots on my tiny MacBook Air SSD.
Source: SourceForge
Via: MacWorld