#Source Code:

#Installing imagemagick

$  identify -version

#Download ImageMagick.tar.gz from www.imagemagick.org

$ tar xvfz ImageMagick.tar.gz

$ cd ImageMagick-x.x.x

$ ./configure

$ make

$ sudo make install

$ sudo ldconfig /usr/local/lib

$ /usr/local/bin/convert logo: logo.gif

$ make check

#to convert an image in the JPEG format to PNG

$ convert blue_rose.jpg blue_rose.png

#to reduce the image size before it is written to the PNG format

$ convert blue_rose.jpg -resize 50% blue_rose.png

#to create a version PNG version of all your JPG files

mogrify -format png *.jpg

#to combine multiple image-processing operations to produce complex results

$ convert -size 320x85 canvas:none -font Bookman-DemiItalic -pointsize 72 \

-draw "text 25,60 'Magick'" -channel RGBA -blur 0x6 -fill darkred -stroke magenta \

-draw "text 20,55 'Magick'" fuzzy-magick.png

#For more examples

#http://www.imagemagick.org/Usage/

yellow_rose.py

from PIL import Image

from numpy import *

from pylab import *

import cv

im = cv.LoadImageM("yellow_rose.jpg")

print type(im)

cv.NamedWindow("Rose", cv.CV_WINDOW_AUTOSIZE )

cv.ShowImage("New Rose", im)

cv.WaitKey(10000)

cv.SaveImage("new_yellow_rose.png", im)

cv.DestroyWindow("Rose")

resized_yellow.py

from PIL import Image

from numpy import *

from pylab import *

import cv

original = cv.LoadImageM("yellow_rose.jpg")

print type(original)

cv.NamedWindow("Resized", cv.CV_WINDOW_AUTOSIZE )

resized = cv.CreateMat(original.rows / 10, original.cols / 10, cv.CV_8UC3)

cv.Resize(original, resized)

cv.ShowImage("Resized", resized)

cv.WaitKey(10000)

cv.SaveImage("resized_yellow_rose.png", resized)

cv.DestroyWindow("Resized")