-
-
Save VincentSit/b76dcfce084e030a68556a6f9c18cb87 to your computer and use it in GitHub Desktop.
Save this shell script to generate @2x and 1x PNG assets for your apps. Requires Imagemagick (http://www.imagemagick.org/). These will probably look shitty and blurred.
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/sh | |
# Example usage | |
# cd into directory that has @3x images | |
# ./whatever-you-name-this.sh | |
# Remember to chmod +x the script | |
resize () { | |
ls *@3x.png | awk '{print("convert "$1" -filter box -resize '$1' "$1)}' | sed 's/@3x/'$2'/2' | /bin/sh | |
} | |
resize 66.67% @2x | |
resize 33.33% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment