-
-
Save benvium/5419529 to your computer and use it in GitHub Desktop.
Resize all @3x images in a folder to @2x and @1x sizes. Using this script you need only ever edit the @3x images. Drop this script into the folder containing your images and double-click it in Finder to run. Note it will destructively overwrite the @2x and @1x-sized images, so be careful. Don't run this script in a folder that's not under versio…
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/bash -e | |
# Ensure we're running in location of script. | |
cd "`dirname $0`" | |
for f in *; do | |
if [[ $f == *@3x* ]]; | |
then | |
echo "$f -> ${f//@3x/@2x}, ${f//@3x/}" | |
convert "$f" -resize 66.66666% "${f//@3x/@2x}" | |
convert "$f" -resize 33.33333% "${f//@3x/}" | |
fi | |
done | |
echo "Complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Worked like a charm, thanks!