Skip to content

Instantly share code, notes, and snippets.

@SlaunchaMan
Created December 7, 2012 15:57
Show Gist options
  • Save SlaunchaMan/4234170 to your computer and use it in GitHub Desktop.
Save SlaunchaMan/4234170 to your computer and use it in GitHub Desktop.
Making non-Retina graphics
#!/bin/bash
# Your designer should be making you assets in both resolutions.
# By that, I mean they don’t just resize in Photoshop and export,
# but they actually *design* for both resolutions. Failing that,
# run this. You’ll need ImageMagick installed and in your PATH.
# The script will operate on *all* images in the current directory
# with the suffix @2*.png. Why @2* instead of @2x? In case you do
# this for iPhone 5:
#
# [email protected]
#
# Why would you want non-retina iPhone 5 graphics? Easy: Interface
# Builder.
for x in *@2*.png; do
newfilename="$(echo $x | sed -e 's/@2x//g')"
if [ ! -f "$newfilename" ]; then
echo $newfilename
convert $x -resize 50% $newfilename
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment