Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rnystrom/2311817 to your computer and use it in GitHub Desktop.
Save rnystrom/2311817 to your computer and use it in GitHub Desktop.
A simple bash script using OSX command line tool sips to resample a 512x512px image
#!/bin/zsh
# Compatible with bash, just change "zsh" to "bash"
# First param: The folder that the original file is stored in
# Second param: The original image name
sips --resampleWidth 512 "${1}/${2}" --out "${1}/iTunesArtwork"
sips --resampleWidth 57 "${1}/${2}" --out "${1}/Icon.png"
sips --resampleWidth 114 "${1}/${2}" --out "${1}/Icon@2x.png"
sips --resampleWidth 29 "${1}/${2}" --out "${1}/Icon-Small.png"
sips --resampleWidth 58 "${1}/${2}" --out "${1}/Icon-Small@2x.png"
sips --resampleWidth 50 "${1}/${2}" --out "${1}/Icon-Small-50.png"
sips --resampleWidth 72 "${1}/${2}" --out "${1}/Icon-72.png"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment