Skip to content

Instantly share code, notes, and snippets.

@zealinux
Created September 26, 2012 13:59
Show Gist options
  • Save zealinux/3788224 to your computer and use it in GitHub Desktop.
Save zealinux/3788224 to your computer and use it in GitHub Desktop.
imagemagick convert cheat sheet
= IMAGEMAGICK
Working with images, PDFs and the command line
# convert from one format to another
convert image.gif image.jpg
# convert specific PDF page to image
convert -thumbnail x300 test.pdf[0] test.png
# create thumbnails for all pages in PDF document
convert -thumbnail x300 test.pdf test.png
# as above, controlling the width, having height suited
convert -thumbnail 400 test.pdf test.png
# 转换成宽度为400的缩略图
convert -thumbnail x400 1.jpg 1.tn.jpg
# crop an image from the bottom corner
convert -crop '595x711-0+1309' image.jpg output.jpg
# make a looping animated gif
convert -delay 20 -loop 0 image*.jpg image.gif
# resize image
convert -resize 50% source.png dest.png
# rotate image (-90 degrees)
convert -rotate -90 source.png dest.png
# see list of available compression methods
convert -list compress
@AdeleB
Copy link

AdeleB commented Sep 9, 2014

Besides below formats, is this pdf converstion tool support other image formats, like tiff, muti-page tiff, bmp, svg, etc.
convert image.gif image.jpg

convert specific PDF page to image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment