Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ImageMagick is a free and open-source software suite for displaying, converting, and editing raster image and vector image files. It can read and write over 200 image file formats.

ImageMagick Commands

  • identify – Print the details of imagces, that IM sees
  • Convert – Convert and Modify Images
  • Mogrify – in-place batch processing
  • -quality value – JPEG/MIFF/PNG compression level

转换格式

nikon.NEF 转换为 png 格式图片

convert -verbose nef/nikon.NEF jpg/nikon.png

nef/KUN_34.NEF* 批量转换为 jpg 格式图片,保存到 jpg 目录下

mogrify -verbose -path jpg -format jpg nef/KUN_*.NEF

转换大小

lock.PNG 压缩为 1920x1080 大小的 lock1080.PNG图片

magick -verbose lock.PNG -resize 1920x1080 lock1080.PNG

批量压缩

mogrify -verbose -path jpg1080 -resize 1920x1080 jpg/KUN_35*.jpg

ico

convert -resize 128x -gravity center -crop 128x128+0+0 bougainvilleas.png -background transparent bougainvilleas.ico