Created
December 17, 2018 08:33
-
-
Save Neoglyph/b2bf7ea2ca7c0ce21ae2b9ec95af0404 to your computer and use it in GitHub Desktop.
Simple shell script to resize images to specific sizes with imagemagick
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shopt -s nullglob | |
for i in *.png; do | |
echo "Resizing $i" | |
FILE=$i | |
FILENAME="${FILE%%.*}" | |
EXT="${FILE##*.}" | |
convert $FILE -resize 270x "./resized/${FILENAME}-270.${EXT}" | |
convert $FILE -resize 320x "./resized/${FILENAME}-320.${EXT}" | |
convert $FILE -resize 560x "./resized/${FILENAME}-560.${EXT}" | |
convert $FILE -resize 800x "./resized/${FILENAME}-800.${EXT}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment