Skip to content

Instantly share code, notes, and snippets.

@DawnPaladin
Created August 15, 2016 18:26
Show Gist options
  • Save DawnPaladin/2efed828b5a465f9fc913c3547821aa3 to your computer and use it in GitHub Desktop.
Save DawnPaladin/2efed828b5a465f9fc913c3547821aa3 to your computer and use it in GitHub Desktop.
ImageMagick commands
This ImageMagick command takes all the .png files in a folder, resizes them to a maximum of 200x200px, and deposits them in the IM-processed folder:
mogrify -path IM-processed -resize 200x200 *.png
Note that the IM-processed folder must already exist.
To create a folder full of thumbnails:
mogrify -format gif -resize 125x125 -background transparent -gravity center -extent 125x125 -path thumbnails *t.*
This means: “Run the ImageMagick command mogrify. On the images I am about to send you:
• Convert each one to GIF
• Resize them (maintaining proportions) to fit into a 125x125 pixel box
• Give them a transparent background
• Keep the image centered on the canvas
• Extend the canvas to 125x125 pixels
• Place them in the ‘thumbnails’ folder
Do this on all images ending with the letter ‘t’.”
To rename *fs.* to *t.*, run this PowerShell command:
Dir | Rename-Item –NewName { $_.name –replace "fs","t" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment