Last active
November 12, 2018 17:15
-
-
Save donaldsteele/7b0843db6675269599c9b565ebc4fe68 to your computer and use it in GitHub Desktop.
Convert folder of svg files to standard windows icon sized .ico files using imagemagik
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 | |
#requires imagemagik, inkscape and pngquant | |
#sizes you wish to create | |
size=(16 32 24 48 72 96 144 152 192 196 256) | |
for file in *.svg; do | |
base=${file%.*} | |
for i in ${size[@]}; do | |
inkscape $file --export-png="${base}_${i}.png" -w$i -h$i --without-gui | |
pngquant -f --ext .png "${base}_${i}.png" --posterize 4 --speed 1 | |
convert "${base}_${i}.png" "${base}_${i}.ico" | |
echo "$file" "${base}" | |
done | |
convert $(ls -v ${base}_*.ico) ${base}.ico | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment