ImageMagick: Weaving Magic With Your Pictures


I’ve known about ImageMagick tools for quite some time now but never dabbled with it. A couple of weeks ago I played with it for some time (notice the new cascaded polaroid pics header above) and was amazed even more. Few of its shining features:

  • It has almost unlimited features to manipulate your images through its tools like convert, montage, mogrify etc and their long list of options.

  • It is available for Windows, Linux and Mac as well.

  • Runs on web servers also (most of those nifty image sites use it for run time image manipulation)

  • It is amazingly fast.

  • Runs on the command line, which means batching of operations can be done and is also good for butter fingered people like me who are clumsy with GUI based image manipulation programs

  • Has modules for interfacing with C, perl, php, C++, C#, java, etc. So, you can create your own applications around it.

  • It’s FREE (as in speech and as in beer)

  • It has an amazing documentation over at imagemagick.org and also a very thriving community, so help is just a few clicks away.

As a very rudimentary sample of what it can do for you, take a look at my blog’s header above. I just gave it a few pics and ran a command, and it resized them, turned them into polaroid pics, rotated them at random angles, made the background transparent, strung them together to make a webpage header/banner.

Since the command was specific for the number and names of images, I made a simple perl script to automate the command making process so you can also download this script (link at the end of post) and run it to create your own header. (You might want to tweak the $w and $h variables in the script to specify your header’s width and height). Running it would be like

./pano.pl <imagenames>

e.g.

./pano.pl myimages/*

After I made this script, I came across Stas Bekman’s photo gallery which has a much better and cool stack effect with photos. And he generously agreed to share his script (much more sophisticated than my my few lines) with me. His script is also attached below.

Let me know if you use any of these scripts (as it is or after modifying them) to create any cool effects.


See also