Tuesday, October 30, 2012

Image Magick III - Invert an image

Three ways to invert an image:

convert black-white.png -negate white-black.png
convert upside-down.png -rotate 180 rightside-up.png
convert upside-down.png -flip rightside-up.png


From: http://www.imagemagick.org/pipermail/magick-users/2003-October/011071.html

Friday, October 5, 2012

indent

Indent is an program that can reformat C code for you.

Today, someone emailed me their strangely formatted code and I decided before I even looked at it that I would run it through "indent." After looking through the man page for the "correct" flags, I settled on a style.

I personally like my code to look roughly like this:

$  indent -bad -bap -bl -blf -bls -i4 -nbfda -nprs -npsl -saf -sai -saw filename