Created
June 2, 2020 07:06
-
-
Save jameslzhu/51c299c9a591bebc2ba68f1a47bb1fcf to your computer and use it in GitHub Desktop.
Converts a favicon SVG to PNG and ICO.
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
#!/usr/bin/env bash | |
# Convert svg to png with inkscape | |
inkscape --export-type=png -o assets/images/favicon.png -w 64 -h 64 \ | |
--export-background-opacity=0 \ | |
./assets/images/favicon.svg | |
# Convert png to ico with imagemagick | |
convert ./assets/images/favicon.png \ | |
\( -clone 0 -resize 16x16 \) \ | |
\( -clone 0 -resize 32x32 \) \ | |
\( -clone 0 -resize 48x48 \) \ | |
\( -clone 0 -resize 64x64 \) \ | |
-delete 0 -alpha remove -colors 256 favicon.ico |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment