Creativebits.org

an All Creative World site
Ivan's picture

Command line image manipulation

By using OS X, that is based on Unix you're already part of the cool crowd. However, if you want to be a real geek designer, you need to be able to manipulate your images from the Terminal. Just learn this and watch the trainees eat from the palm of your hand.

The sips command allows you basic image manipulation, such as resampling, flipping, rotating, cropping. It also lets you view, detach and attach Profiles to an image file. To test the function of this command put a jpg file on your desktop and name it sample.jpg. Now that the sample image is ready for manipulation open Terminal and type:

cd ~/desktop

This will take you to your desktop. You can list the content of your desktop by punching in:

ls

You should be able to find your sample.jpg. Now let's test the sips command:

sips sample.jpg -z 300 300

This will resize your image to 300 height by 300 width pixels. Check the result in Preview. Another command:

sips sample.jpg -c 100 100

This will crop it to 100x100 pixels. Notice that this way you are overwriting the file. For the complete usage guide type:

sips --help

I've tested it on a hi-res 9MB jpg file and resized it to 100x100px. It was extremely fast, almost took no time to get it done. Now, that I told you about this command, you tell me what can you use it for, besides getting chicks of course?

Commenting on this Blog entry is closed.

John's picture

You can use it in a web interface. For example, if you were going to allow people to post images to a forum, you could automatically have sips (through a PHP form/cgi call for example) resize the image to no larger than your stated maximum size.

Anonymous's picture

Another way to go, is install ImageMagick (http://imagemagick.sourceforge.net/). Allows for much more control over conversion, manipulation, compositing etc.

Creativebits is a blog about creativity, design and Macs. We also have a critique section where you can post your work to get opinions and a forum to discuss any design related topics.

Recommend us on Google

Latest critique

Do you need a great new logo?

If you need a logo for your company or product you can get it done with us.
In our logo store you can pick from over 28,000 pre-made logos that will be customized to your name for free or you can post a contest for us for just $250 and our designers from all over the world will submit dozens of logo design suggestions to your specific needs.

Marketplace