Table of Contents

ImageMagick

ImageMagick is a command-line tool for processing image files.

This tool is not suitable for processing RAW images; darktable is recommended instead.

Install

environmentcommand
archlinuxpacman -S imagemagick
mingw-w64pacman -S mingw-w64-i686-imagemagick
brew on macbrew install imagemagick

additional libraries

Please note that you must also install libraries to handle specific image formats.

formatrequired library
webplibwebp

Command

convert

convert src.png [options] dst.jpg  # output format is recognized by an extension
optiontarget formatdescription
-auto-orient*Rotates the raw image according to the metadata orientation, and removes the orientation tag.
-resize X%*Resize the image by the specified percentage.
-strip*Removes any metadata.
-define webp:method=NwebpQuality of webp format(1~6).
A higher value results in stronger compression and lower quality.

Command Examples

Compress into webp for blogs

convert $i -define webp:method=6 -resize 15% -auto-orient -strip ${i%.jpg}.webp