15 April 2012

ImageMagick Cheat Sheet

The following commands were taken from the internet, I will give acknowledge when found:


Command to create thumbnail:
convert -geometry 100x100 -quality 100 orgfilename.jpg thumbfilename.jpg

Command to rotate image:
convert orgfilename.jpg -rotate 60 rotated60.jpg

Command to croping an image:
convert orgfilename.jpg -crop 128×128+50+50 cropped.jpg

Command to convert a directory of png images to gif:
mogrify -format gif *.png

Command to watermarking with text:
convert orgfilename.jpg -font Arial -pointsize 20 -draw "gravity south fill black text 0,12 'Watermark' fill white text 1,11 'Watermark' " wmark_text_drawn.jpg

Command to convert pdf to png
convert pdffile.pdf -colorspace RGB -resample 72×72 -units PixelsPerInch -quality 90 -resize 500×500 -size 500×500 pngfile.png

Convert jpg to pdf
convert *.jpg output.pdf

PDF too big (from jpg)
convert -quality 60 *.jpg output.pdf

Resize an image:
convert image.jpg -resize 800 image.png
(porcentaje no me funco bien)

mogrify -path xx -resize 800 *.jpg

cd to the directory where your images are located (temp) after creating a new directory to hold the changed files (say, temp2)
mogrify -path fullpathto/temp2 -resize 60x60% -quality 60 -format jpg *.png

Compare to images:
compare image1 image2 -compose src diff.png
estas imagenes pueden ser en diferente formato inclusive ! 
compare PC-200617-1248-30.pdf PC-270717-1119-53.pdf diff.pdf (pdf)
Append two images:
convert image1.jpg image2.jpg -append result.jpg 

To verify ImageMagick is working properly, type the following in an MS-DOS Command Prompt window:

$ convert logo: logo.gif
$ identify logo.gif
$ imdisplay


No comments :

My Blog List

Blog Archive

There was an error in this gadget


The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.