Skip to content

Instantly share code, notes, and snippets.

@lloydroc
Created September 18, 2017 05:15
Show Gist options
  • Save lloydroc/aedc107a8ce43129810ff660677042d1 to your computer and use it in GitHub Desktop.
Save lloydroc/aedc107a8ce43129810ff660677042d1 to your computer and use it in GitHub Desktop.
Resize Images in Mac OS X
# Will resize the image given in the first parameter
# to 100x100, 200x200, and 300x300 with
# respective filenames @1x, @2x, @3x
NAME=$(echo "$1" | cut -d'.' -f1)
EXTENSION=$(echo "$1" | cut -d'.' -f2)
sips -z 100 100 $1 --out ../$NAME@1x.$EXTENSION
sips -z 200 200 $1 --out ../$NAME@2x.$EXTENSION
sips -z 300 300 $1 --out ../$NAME@3x.$EXTENSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment