Search Windows and Linux Networking

Thursday, February 28, 2013

How to convert or resize image file using ImageMagick

 convert or resize image using ImageMagick


ImageMagick is a free software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. ImageMagick is available for Linux , Mac and windows.

You can download ImageMagick from http://www.imagemagick.org


For Ubuntu user can install ImageMagick using

sudo apt-get install imagemagic

For CentOS user can install ImageMagick using

yum install ImageMagick ImageMagick-devel

suppose you have image.png file and you wanted to convert it in to jpg format. You can do this with command line with following command

convert  image.png image.jpg

if you have bunch of file suppose .png and  you wanted to convent it in jpg  format then put all .png file in one new directory and go to new directory path and execute following command to convert all png format file in to .jpg format

convert *.png new.jpg

and if you wanted all your jpg file in single one pdf file then you can use following command

convert *.png imagefile.pdf

and if you wanted to create single gif file of all your  jpg file you can do this using command

convert *.jpg newimage.gif
convert -delay 20 *.jpg  newimage2.gif

you can also convert your avi file in to gif  format using command

convert -quiet -delay 1 vidio.avi vidio.gif 


You can resize image by using resize option. for example

convert image.jpg -resize 50% half_image.jpg
 

you can do lot of task using command line with ImageMagick

No comments:

Post a Comment