Last active
October 6, 2015 02:32
-
-
Save kmakita13714/4e6bb745fae32984efa9 to your computer and use it in GitHub Desktop.
This file contains 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
for filename in $(ls *@3x.*); do echo $filename; newFilename=`echo $filename | sed -e 's/@3x/@2x/'`; WIDTH=`gm identify -format "%w" $filename`; (( NEW_WIDTH = $WIDTH / 3 * 2 )); HEIGHT=`gm identify -format "%h" $filename`; (( NEW_HEIGHT = $HEIGHT / 3 * 2 )); echo "${WIDTH}x${HEIGHT}"; echo "${NEW_WIDTH}x${NEW_HEIGHT}"; gm convert -resize "${NEW_WIDTH}x${NEW_HEIGHT}" -unsharp 2x1.4+0.5+0 -quality 100 $filename $newFilename; echo 'done!'; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment