e-Zest members share technology ideas to foster digital transformation.

ImageMagick – the real magic with image

Written by Geetanjali Pukale | Oct 16, 2014 6:52:46 PM

Handling an image and dealing with an image has always been a hurdle for any programmer. Life has undoubtedly become simpler with ImageMagick.

What is ImageMagick?

ImageMagick® is a software suite that helps create, edit, compose, or convert bitmap images.

It reads and writes images in a variety of formats such as (over 100) including DPX, JPEG, EXR, GIF, JPEG-2000, PNG, Postscript, SVG, and TIFF, PDF. One can easily use ImageMagick to resize, distort, shear, transform images, flip, mirror, rotate, adjust image colors, or draw text, lines, polygons, ellipses, apply various special effects and Bézier curves.

Image magic is basically a command line and you can use it in any of languages e.g. Java, LISP, PHP, Python, .Net and many more. The magic is when you use this tool, you create all the images dynamically and moreover, if you wish to store them then you explicitly have to save them, else, they don’t occupy the memory. All the effects can be achieved using Photoshop or say by some other tool, but the problem will be that, all the images will need to be stored on the drive and at some point you may not need so many intermediate images to be stored at all.

ImageMagick can be downloaded from

http://www.imagemagick.org/download/

Here are few examples of images using image magic

Comparing two images:

Command would be: compare bag_frame1.gif bag_frame2.gif compare.gif

The last image is the compared result. Very useful when you want to complex image comparison only one line could save all the efforts.

Command would be: convert thumbnail.gif -mattecolor peru -frame 9x9+3+3 framed.gif


Command would be: composite -compose bumpmap -tile rings.jpg \ dragon.gif dragon_rings.jpg

Where ImageMagick can be useful?
Say online t-shirt designing, here we can add images on to the t-shirt add text to t-shirt too.
Online wall paper designing is also an option. Various images composition can be easily merger.
Greeting card sites, Mug designing sites.

More help can be found at: http://www.imagemagick.org/Usage/