Created
May 15, 2016 09:22
-
-
Save kampfgnu/db8ccbb7c1263aff257af7b50e0b9d4e to your computer and use it in GitHub Desktop.
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
#!/bin/bash -e | |
# batch resize @3x iOS image assets to @2x and @1x | |
# copy this script to the folder where the @3x images files live and run "./resizer3x.sh" in terminal. | |
# this will generate [filename]@2x.[extension] and [filename].[extension] images in the same folder | |
# Ensure we're running in location of script. | |
cd "`dirname $0`" | |
for f in *; do | |
if [[ $f == *@3x* ]]; | |
then | |
convert "$f" -resize 66.6% "${f//@3x/@2x}" | |
convert "$f" -resize 33.3% "${f//@3x/}" | |
fi | |
done | |
echo "Complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment