Created
February 27, 2020 03:36
-
-
Save ikey4u/659f38b4d7b3484d0b55de85a55a8154 to your computer and use it in GitHub Desktop.
Generate Mac icns icon from svg using inkscape
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
inkscape=/Applications/Inkscape.app/Contents/MacOS/inkscape | |
insvg=burpicon.svg | |
output=burp | |
outdir=${output}.iconset | |
mkdir $outdir | |
for sz in 16 32 128 256 512 | |
do | |
echo "[+] Generete ${sz}x${sz} png..." | |
$inkscape --without-gui --export-file ${outdir}/icon_${sz}x${sz}.png -w $sz -h $sz $insvg | |
$inkscape --without-gui --export-file ${outdir}/icon_${sz}x${sz}@2x.png -w $((sz*2)) -h $((sz*2)) $insvg | |
done | |
iconutil --convert icns --output ${output}.icns ${outdir} | |
echo "[v] The icon is saved to ${output}.icns." | |
rm -rf ${outdir} |
insvg=$1
output=$2
outdir=${output}.iconset
mkdir $outdir
for sz in 16 32 128 256 512
do
echo "[+] Generete ${sz}x${sz} png..."
inkscape --export-filename=${outdir}/icon_${sz}x${sz}.png -w $sz -h $sz $insvg
inkscape --export-filename=${outdir}/icon_${sz}x${sz}@2x.png -w $((sz*2)) -h $((sz*2)) $insvg
done
iconutil --convert icns --output ${output}.icns ${outdir}
echo "[v] The icon is saved to ${output}.icns."
rm -rf ${outdir}
![Windows_Settings_10](https://gist.github.com/assets/161981956/805be08f-0092-479a-912b-b6f54a0b5d82]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works with latest version of inkscape, remove the "--without-gui" and change the "--export-file" with "--export-filename"