Created: 2017-07-18 09:52:19 -0700 Modified: 2017-10-27 16:28:39 -0700
BasicsSection titled Basics
ImageMagick has a bunch of commands for things like resizing, animating, etc.
Install it from here. If you choose to add it to your path, then you should be able to just use “magick.exe” from a new CMD window. WARNING: by adding it to your path, you’ll also get an outdated version of ffmpeg in your path. For that reason, make it so that ImageMagick is low on the priority of your PATH variable so that you get your desired ffmpeg version.
Working with directoriesSection titled Working with directories
I don’t think ImageMagick has a way to work with directories, so you should use your shell for this. ImageMagick has some guidance for this here.
I ended up just using this because I didn’t need to do things recursively:
cd /d C:input _images
for /r %i in (*) do magick %i -resize 64x64 “C:output _images~ni%~xi”
Note: for an explanation on what ”%~ni” is, take a look at this page.
Example scriptsSection titled Example scripts
This page has a bunch of common scripts for ImageMagick.
Resizing images from the command line (reference)Section titled Resizing images from the command line (reference)
magick example.png -resize 64x64 example2.png
Note: it will maintain the same aspect ratio you had on the source image, so you may end up with a size like 64x59.
If you want to ignore the aspect ratio, specify a size with "" at the end like 64x64\