Saturday, October 15, 2011

OSX Command line image editing

If you are away from home, or just need some very light weight image processing here's two that are useful:

increasing jpeg compression because your connectivity is not so good, use 'sips'. Its built into OSX

    sips --setProperty formatOptions normal 1.jpg

or, for all images in a folder

    sips --setProperty formatOptions normal *

    sips --setProperty formatOptions normal *

SIPS can also take a % for finer control


    sips --setProperty formatOptions 30 *

If you want to use lossles rotation, the get nconvert from http://www.xnview.com/en/features_nc.html

Assuming you leave it in your downloads folder then the command to rotate 90 degrees anti-clockwise would be

    ~/Downloads/NConvert/nconvert -overwrite -jpegtrans rot90 1.jpg


After these, you'll find the date/time stamp of your files is wrong, so use jhead to put them back. First get it from http://www.sentex.net/~mwandel/jhead/

then the command would be

    ~/Downloads/jhead/jhead -ft *.jpg
    ~/Downloads/jhead/jhead -ft *.JPG

you'll note that its case sensitive.

1 comment:

opu shaon said...

Fine, this is another sound like very good allocation about OSX command line image editing. So its a very nice input of you and I think that here provided instruction will surely be handy for everyone to now that how to do OSX command line image editing. Thanks :)
image editing services