Last active
June 25, 2019 09:00
-
-
Save ldenoue/1c35957799a4a98d216a31b259d22d52 to your computer and use it in GitHub Desktop.
make app icon for iOS using ffmpeg
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
if [ "$#" -eq 2 ] | |
then | |
mkdir $2 | |
ffmpeg -y -i $1 -vf scale=20x20 $2/[email protected] | |
ffmpeg -y -i $1 -vf scale=40x40 $2/[email protected] | |
ffmpeg -y -i $1 -vf scale=60x60 $2/[email protected] | |
ffmpeg -y -i $1 -vf scale=29x29 $2/[email protected] | |
ffmpeg -y -i $1 -vf scale=58x58 $2/[email protected] | |
ffmpeg -y -i $1 -vf scale=87x87 $2/[email protected] | |
ffmpeg -y -i $1 -vf scale=40x40 $2/[email protected] | |
ffmpeg -y -i $1 -vf scale=80x80 $2/[email protected] | |
ffmpeg -y -i $1 -vf scale=120x120 $2/[email protected] | |
ffmpeg -y -i $1 -vf scale=120x120 $2/[email protected] | |
ffmpeg -y -i $1 -vf scale=180x180 $2/[email protected] | |
ffmpeg -y -i $1 -vf scale=76x76 $2/[email protected] | |
ffmpeg -y -i $1 -vf scale=152x152 $2/[email protected] | |
ffmpeg -y -i $1 -vf scale=167x167 $2/[email protected] | |
ffmpeg -y -i $1 -vf scale=1024x1024 $2/[email protected] | |
cat <<EOT > $2/Contents.json | |
{ | |
"images" : [ | |
{ | |
"size" : "20x20", | |
"idiom" : "iphone", | |
"filename" : "[email protected]", | |
"scale" : "2x" | |
}, | |
{ | |
"size" : "20x20", | |
"idiom" : "iphone", | |
"filename" : "[email protected]", | |
"scale" : "3x" | |
}, | |
{ | |
"size" : "29x29", | |
"idiom" : "iphone", | |
"filename" : "[email protected]", | |
"scale" : "1x" | |
}, | |
{ | |
"size" : "29x29", | |
"idiom" : "iphone", | |
"filename" : "[email protected]", | |
"scale" : "2x" | |
}, | |
{ | |
"size" : "29x29", | |
"idiom" : "iphone", | |
"filename" : "[email protected]", | |
"scale" : "3x" | |
}, | |
{ | |
"size" : "40x40", | |
"idiom" : "iphone", | |
"filename" : "[email protected]", | |
"scale" : "2x" | |
}, | |
{ | |
"size" : "40x40", | |
"idiom" : "iphone", | |
"filename" : "[email protected]", | |
"scale" : "3x" | |
}, | |
{ | |
"size" : "60x60", | |
"idiom" : "iphone", | |
"filename" : "[email protected]", | |
"scale" : "2x" | |
}, | |
{ | |
"size" : "60x60", | |
"idiom" : "iphone", | |
"filename" : "[email protected]", | |
"scale" : "3x" | |
}, | |
{ | |
"size" : "20x20", | |
"idiom" : "ipad", | |
"filename" : "[email protected]", | |
"scale" : "1x" | |
}, | |
{ | |
"size" : "20x20", | |
"idiom" : "ipad", | |
"filename" : "[email protected]", | |
"scale" : "2x" | |
}, | |
{ | |
"size" : "29x29", | |
"idiom" : "ipad", | |
"filename" : "[email protected]", | |
"scale" : "1x" | |
}, | |
{ | |
"size" : "29x29", | |
"idiom" : "ipad", | |
"filename" : "[email protected]", | |
"scale" : "2x" | |
}, | |
{ | |
"size" : "40x40", | |
"idiom" : "ipad", | |
"filename" : "[email protected]", | |
"scale" : "1x" | |
}, | |
{ | |
"size" : "40x40", | |
"idiom" : "ipad", | |
"filename" : "[email protected]", | |
"scale" : "2x" | |
}, | |
{ | |
"size" : "76x76", | |
"idiom" : "ipad", | |
"filename" : "[email protected]", | |
"scale" : "1x" | |
}, | |
{ | |
"size" : "76x76", | |
"idiom" : "ipad", | |
"filename" : "[email protected]", | |
"scale" : "2x" | |
}, | |
{ | |
"size" : "83.5x83.5", | |
"idiom" : "ipad", | |
"filename" : "[email protected]", | |
"scale" : "2x" | |
}, | |
{ | |
"size" : "1024x1024", | |
"idiom" : "ios-marketing", | |
"filename" : "[email protected]", | |
"scale" : "1x" | |
} | |
], | |
"info" : { | |
"version" : 1, | |
"author" : "ldenoue" | |
} | |
} | |
EOT | |
else | |
echo "please pass your image filename and a directory to put results in" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment