How do I embed multiple sizes in an .ico file? – Super User
Posted by jpluimers on 2016/12/06
Scripts are soooo coool.
I remember doing similar things in Windows, but couldn’t find the batch files any more. There is an example (thanks Rob W for answering, thanks Suchipi for asking) that works in Mac/Linux:
ImageMagick (Windows/Mac/Linux) contains a command-line tool called convert that can be used for many things, including packing multiple images in one icon:
convert 16.png 32.png 48.png 128.png 256.png -colors 256 icon.ico
The previous command takes 5 PNG images, and combines them into a single .ico file.
Unlike the other answers, this method can easily be used in batch scripts to automatically generate several icon files. In one of my projects, I have a single vector image (SVG), and use Inkscape to generate png’s of various sizes, followed by convert to create a icon container. This is a reduced example (in a bash script):
#!/bin/bash for size in 16 32 48 128 256; do inkscape -z -e $size.png -w $size -h $size icon.svg >/dev/null 2>/dev/null done convert 16.png 32.png 48.png 128.png 256.png -colors 256 icon.ico
–jeroen
via:
Leave a Reply