Created
June 2, 2014 19:50
-
-
Save Lerg/02e228b0f5423bbaf1dc 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
#!/bin/sh | |
ext=$1 | |
for f in $(find . -name "*@4x.$ext"); do | |
echo "Converting $f..." | |
convert "$f" -resize '50%' -unsharp 1x4 "$(dirname $f)/$(basename -s "@4x.$ext" $f)@2x.$ext" | |
done | |
for f in $(find . -name "*@2x.$ext"); do | |
echo "Converting $f..." | |
convert "$f" -resize '50%' -unsharp 1x4 "$(dirname $f)/$(basename -s "@2x.$ext" $f).$ext" | |
done |
You need to install ImageMagick for this to work
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
./downsize.sh jpg
./downsize.sh png