Last active
February 25, 2018 03:02
-
-
Save jessedc/837916 to your computer and use it in GitHub Desktop.
A simple bash script using OSX command line tool sips to resample a 1024x1024 image
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 | |
f=$(pwd) | |
sips --resampleWidth 512 "${f}/${1}" --out "${f}/iTunesArtwork" | |
sips --resampleWidth 1024 "${f}/${1}" --out "${f}/iTunesArtwork@2x" | |
sips --resampleWidth 57 "${f}/${1}" --out "${f}/Icon.png" | |
sips --resampleWidth 114 "${f}/${1}" --out "${f}/Icon@2x.png" | |
sips --resampleWidth 29 "${f}/${1}" --out "${f}/Icon-Small.png" | |
sips --resampleWidth 58 "${f}/${1}" --out "${f}/Icon-Small@2x.png" | |
sips --resampleWidth 50 "${f}/${1}" --out "${f}/Icon-Small-50.png" | |
sips --resampleWidth 72 "${f}/${1}" --out "${f}/Icon-72.png" | |
sips --resampleWidth 144 "${f}/${1}" --out "${f}/Icon-72@2x.png" |
Thanks! I've updated the bash file with some new sizes for iPhone 6 (plus) : https://gist.github.com/Gerharbo/eb9ff1097b5c1a07c91a
Update for Xcode 8 - September 2016 https://gist.github.com/DenHeadless/1a04ab4eceb2b5fac2cf7ae00b0863e8
Getting Error
saravanas-Mac-mini:~ Saravana$ /Users/Folder/Desktop/untitled_folder/iOS\ Icon.png\ bash\ script ; exit;
Warning: /Users/Folder/ not a valid file - skipping
Error 4: no file was specified
Try 'sips --help' for help using this tool
Warning: /Users/Folder/ not a valid file - skipping
Error 4: no file was specified
Try 'sips --help' for help using this tool
Warning: /Users/Folder/ not a valid file - skipping
Error 4: no file was specified
Try 'sips --help' for help using this tool
Warning: /Users/Folder/ not a valid file - skipping
Error 4: no file was specified
Try 'sips --help' for help using this tool
Warning: /Users/Folder/ not a valid file - skipping
Error 4: no file was specified
Try 'sips --help' for help using this tool
Warning: /Users/Folder/ not a valid file - skipping
Error 4: no file was specified
Try 'sips --help' for help using this tool
Warning: /Users/Folder/ not a valid file - skipping
Error 4: no file was specified
Try 'sips --help' for help using this tool
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the script, very handy!