png2ico(1)                  General Commands Manual                 png2ico(1)



[1mNAME[0m
       png2ico - convert .PNG file(s) to Windows .ICO icon resource


[1mSYNOPSIS[0m
       [1mpng2ico [22moutfile.ico [--colors <num>] infile1.png [infile2.png ...]


[1mDESCRIPTION[0m
       [1mpng2ico  [22mtakes  the input files and stores them in the output file as a
       Windows icon resource. Usually the input files would all represent  the
       same  image  in  different  resolutions  (common resolutions are 16x16,
       32x32 and 64x64). A program reading the icon  resource  will  pick  the
       image  closest to its desired resolution and will then scale it if nec‐
       essary.

       Using the parameter [4m--colors[24m you can specify the number  of  colors  to
       use  for  the images that follow [4m--colors[24m on the command line.  Allowed
       values are 2, 16 and 256. If omitted, 256 colors will be used. [4m--colors[0m
       can  be specified multiple times to store images with different numbers
       of colors in the same icon file. If the source image has more than  the
       specified number of colors, color reduction will be performed.


[1mFAVICON.ICO[0m
       Most graphical browsers today support the [4mfavicon.ico[24m file. When a user
       bookmarks a web page, the browser will automatically check if it  finds
       a  [4mfavicon.ico[24m  file  on the web server and display it in the bookmarks
       menu.  Depending on the browser and configuration the  [4mfavicon.ico[24m  may
       also appear in other places.

       To  create a [4mfavicon.ico[24m simply create a 16x16 .PNG file and convert it
       to an icon resource with [1mpng2ico[22m. You may of course add other  alterna‐
       tive resolutions but most browsers only use a 16x16 image. Keep in mind
       that for a user with a slow modem a [4mfavicon.ico[24m may increase  the  page
       loading  time  by a few seconds if it is too large, so don't overdo it.
       Adding a 32x32 alternative should be enough to make sure the image will
       look  good  even  in  contexts  with larger icons. Adding even more and
       larger alternatives is unnecessary bloat.  Try to keep  the  number  of
       colors below 16 and create a 16-color icon using the [4m--colors[24m [4m16[24m switch
       of [1mpng2ico [22m(or even create a b/w icon using  the  [4m--colors[24m  [4m2[24m  switch).
       This will result in a smaller file that loads faster.

       Don't  forget  that the [4mfavicon.ico[24m may be composed against backgrounds
       of different colors so you should use transparency rather than a  solid
       background if you want to avoid that your icon appears inside a box.

       To add your new [4mfavicon.ico[24m to a web page put it on the server into the
       same directory as the web page. That is the 1st place  a  browser  will
       look.  If it doesn't find an icon there, it checks the top-level direc‐
       tory of the web server, so by putting it there you can have  a  default
       favicon  for  all  the  pages in your domain.  Depending on browser and
       configuration, the [4mfavicon.ico[24m is not always rendered, even if it is in
       one of the above locations, unless the web page explicitly declares its
       presence. To declare that your web page has an icon, you add  the  fol‐
       lowing 2 lines into the [1m<head> [22msection of your page:

              [1m<link rel="icon" href="favicon.ico" type="image/x-icon">[0m

              [1m<link           rel="shortcut icon"           href="favicon.ico"[0m
              [1mtype="image/x-icon">[0m


[1mEXAMPLES[0m
       To create a favicon.ico from 2 logo files (the 1st in 16x16  resolution
       and the 2nd in 32x32 resolution) you could use the following command:

              [1mpng2ico favicon.ico logo16x16.png logo32x32.png[0m


[1mBUGS[0m
       The color reduction algorithm used by [1mpng2ico [22mis very slow. If you have
       an input file with several thousand colors (very unlikely), it may take
       several  seconds  to create the icon. If possible, reduce the number of
       colors in your .PNG files before passing them to [1mpng2ico[22m.

       The handling of the transparency mask is very inconsistent in programs.
       The  same  program will sometimes interpret it differently depending on
       context.  [1mpng2ico [22mtakes precautions to make sure  that  the  icon  will
       always  look  the  same. For doing this, [1mpng2ico [22muses one palette entry
       for black (0,0,0) and one palette entry for white  (255,255,255),  even
       if  the  icon  does  not have a single black or white pixel. This means
       that 2-color icons will always be  black  and  white.  In  16/256-color
       icons, only 14/254 colors can be chosen freely.


[1mAUTHOR[0m
       Matthias S. Benkmann <matthias@winterdrache.de>.

       [1mpng2ico [22mlives at http://www.winterdrache.de/freeware


[1mSEE ALSO[0m
       [1mconvert(1), gimp(1)[0m



                                9 January 2003                      png2ico(1)
