Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

I just have spent an hour to detect how to create a windows .ico from an existing image.

This time, I document it:

Prerequisites

Install netpbm, which includes ppmtowinico. and imagemagick which provides convert, i.e.:

apt-get install imagemagick netpbm

Define original file name and wanted icon sizes

PICFILE=foo-bar.png
# all formats supported by imagemagick are ok
 
# WinXP supports up to 256, but usually that's a waste of bytes
ICONSIZES="64 48 32 16"

Convert and combine.

for S in $ICONSIZES ; do convert -scale ${S}x${S} $PICFILE ${PICFILE}_${S}x${S}.ppm ; done
 
ppmtowinicon -output ${PICFILE}.ico $(for S in $ICONSIZES ; do echo ${PICFILE}_${S}x${S}.ppm ; done)
  • No labels