Skip to content

Instantly share code, notes, and snippets.

@shawnr
Created August 21, 2015 20:30
Show Gist options
  • Save shawnr/38ac9f370bf274d97d2b to your computer and use it in GitHub Desktop.
Save shawnr/38ac9f370bf274d97d2b to your computer and use it in GitHub Desktop.
Useful ImageMagick Shell Commands
find . -type f \( -iname \*.jpg -o -iname \*.png \) | while read f
do
convert $f -resize 600x $f
done
find . -type f \( -iname \*.jpg -o -iname \*.png \) | while read f
do
convert $f -resize 160x160 -set filename:f "%t.%e" +adjoin "%[filename:f]"
done
# Two commands to run on all files that come in properly named in the dir where they need to be
find . -type f -iname "*.png" | while read f
do
convert $f -scale 100% -set filename:f "%t_2x.%e" +adjoin "%[filename:f]"
convert $f -scale 50% -set filename:f "%t.%e" +adjoin "%[filename:f]"
done
find . -type f -iname "*.png" | while read f
do
convert $f -scale 50% -set filename:f "%t.%e" +adjoin "%[filename:f]"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment