Skip to content

Instantly share code, notes, and snippets.

@asus4 asus4/win8_icon_export.zsh
Last active Aug 29, 2015

Embed
What would you like to do?
Windows8 icon resize script
#!/bin/zsh
# consts
EXPORT_DIR=Icons
FILE_WIDE=logo_wide.png
FILE_SQUARE=logo_square.png
# input folder
function mkdir_ex() {
# create folder
if [ ! -d $1 ]
then
mkdir $1
fi
}
# width height scale filename
function resize_wide() {
sips -z $2 $1 $FILE_WIDE --out $EXPORT_DIR/$4.scale-$3.png
}
# size scale filename
function resize_squere() {
sips -Z $1 $FILE_SQUARE --out $EXPORT_DIR/$3.scale-$2.png
}
mkdir_ex $EXPORT_DIR
resize_wide 248 120 80 WideLogo
resize_wide 310 150 100 WideLogo
resize_wide 434 210 140 WideLogo
resize_wide 558 270 180 WideLogo
resize_squere 56 80 Logo70
resize_squere 70 100 Logo70
resize_squere 98 140 Logo70
resize_squere 126 180 Logo70
resize_squere 120 80 Logo
resize_squere 150 100 Logo
resize_squere 210 140 Logo
resize_squere 270 180 Logo
resize_squere 24 80 SmallLogo
resize_squere 30 100 SmallLogo
resize_squere 42 140 SmallLogo
resize_squere 54 180 SmallLogo
resize_squere 16 80 TargetLogo
resize_squere 32 100 TargetLogo
resize_squere 48 140 TargetLogo
resize_squere 256 180 TargetLogo
resize_squere 50 100 StoreLogo
resize_squere 70 140 StoreLogo
resize_squere 90 180 StoreLogo
resize_squere 24 100 BadgeLogo
resize_squere 33 140 BadgeLogo
resize_squere 43 180 BadgeLogo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.