O7 Logo

Convertir fichier SVG en ICO

Convertir un SVG en un fichier .ICO pour le favicon.ico d'un site

Modules requis

apt install inkscape
apt install imagemagick

Variables

SVGFILE=img_source.svg
ICOFILE=favicon.ico

Convertir SVG en 3 PNG de tailles standards

inkscape --without-gui -w 16 -h 16 --export-png=16.png $SVGFILE
inkscape --without-gui -w 32 -h 32 --export-png=32.png $SVGFILE
inkscape --without-gui -w 96 -h 96 --export-png=96.png $SVGFILE

Convertir les PNG dans un fichier ICO

convert 16.png 32.png 96.png $ICOFILE

Autre commande utilse

# Crop
convert a_logo.png -crop 334x334 334.png

# resize
convert 334.png -resize 32x32 32.png

Pour valider le contenu

identify $ICOFILE