man > pamtowinicon(1)

TLDR: pamtowinicon (tldr-pages)

Convert a PAM image to a Windows ICO file.

  • Convert a PAM image file to an ICO file
    pamtowinicon {{path/to/input_file.pam}} > {{path/to/output.ico}}
  • Encode images with resolutions smaller than `t` in the BMP format and all other images in the PNG format
    pamtowinicon {{-pn|-pngthreshold}} {{t}} {{path/to/input_file.pam}} > {{path/to/output.ico}}
  • Make all pixels outside the non-opaque area black
    pamtowinicon {{-t|-truetransparent}} {{path/to/input_file.pam}} > {{path/to/output.ico}}
Pamtowinicon User Manual(1)            General Commands Manual           Pamtowinicon User Manual(1)

NAME
       pamtowinicon - convert Netpbm PAM images to a Microsoft Windows icon file


SYNOPSIS
       pamtowinicon [-pngthreshold=threshold] [-truetransparent] [-verbose] [pam_file]

       All  options can be abbreviated to their shortest unique prefix.  You may use two hyphens in‐
       stead of one to designate an option.  You may use either white space or equals signs  between
       an option name and its value.


DESCRIPTION
       This program is part of Netpbm(1).

       pamtowinicon  reads  an RGB_ALPHA Netpbm PAM file and converts it to a Microsoft Windows icon
       file.

       The output goes to Standard Output.

       The input is a multi-image PAM file; each image becomes an icon in the output file.   If  you
       have input images in multiple files, you can simply combine them with cat and pass the result
       to pamtowinicon.



OPTIONS
       In  addition  to  the options common to all programs based on libnetpbm (most notably -quiet,
       see ]8;;index.html#commonoptions\Common Options]8;;\ ), pamtowinicon recognizes the following command line options:



       -pngthreshold=threshold
              pamtowinicon encodes images with resolutions above or equal threshold by threshold  as
              PNG  by  running  pnmtopng(1).  Other images it encodes using the more traditional BMP
              format.

              When the program uses PNG encoding for a 5-channel PAM with separate AND mask (see be‐
              low), it discards the AND mask.  Because PNG has always had  the  ability  to  specify
              transparency,  the  Windows  icon format does not provide for a separate and mask when
              the icon is encoded in PNG.

              The default value for threshold is 128.


       -truetransparent
              Make all pixels outside the opaque area black, avoiding inversion and other effects on
              the background of the image (see Windows Icons(1)).


       -verbose
              Print more messages





IMAGES
       pamtowinicon reads a (multi-image) Netpbm PAM file as input and  outputs  an  single  Windows
       icon file containing those images.

       The images in the icon file are in the same order as in the PAM input.



   PAM Input
       pamtowinicon interprets the PAM images as follows, based on the number of channels.

       ────────────────────────────────────────────────────────────────────
       channels   image
       1          fully opaque grayscale image
       2          grayscale image with transparency channel
       3          fully opaque color image
       4          color image with transparency channel
       5          color image with transparency channel and additional AND
       mask

       The tuple types of the PAMs are irrelevant.



   AND Mask
       The so-called "AND mask" is a special feature of Microsoft Windows icons.  It is required for
       all  BMP  encoded  images.  At the first sight, the AND mask is a 1-bit transparency channel,
       but it is also used for e.g. shading the icon while dragging.  See Windows Icons(1)  for  de‐
       tails.

       If there is no explicit AND mask, but transparency data in the input image, pamtowinicon sets
       the  AND  mask to opaque where the sample in the transparency channel is below maxval, and to
       transparent elsewhere.

       If no transparency data is present in the input image, pamtowinicon assumes the  whole  image
       to be fully opaque.



   BMP Output
       When  BMP encoding an image, pamtowinicon tries to use the most compact BI_RGB format allowed
       for icon images with a color depth of eight bits per channel.

       pamtowinicon generates neither 16-bit BI_RGB nor BI_BITFIELDS BMP encoded images, even if the
       maxval of the input PAM is not 255.



SEE ALSOwinicontopam(1)ppmtowinicon(1)pam(1)Windows Icons(1)


       For information on the PNG format, see ]8;;http://schaik.com/png\http://schaik.com/png]8;;\ .



HISTORY
       pamtowinicon was new in Netpbm 10.63 (June 2013).  It  obsoleted  ppmtowinicon  by  providing
       more function and conforming better to Netpbm conventions.



AUTHOR
       Copyright (C) 2013 by Ludolf Holzheid.

       Translated to Netpbm coding style by Bryan Henderson.

DOCUMENT SOURCE
       This  manual  page  was  generated by the Netpbm tool 'makeman' from HTML source.  The master
       documentation is at

              http://netpbm.sourceforge.net/doc/pamtowinicon.html

netpbm documentation                        12 April 2013                Pamtowinicon User Manual(1)
pamtowinicon(1)
NAME SYNOPSIS DESCRIPTION OPTIONS IMAGES SEE ALSO HISTORY AUTHOR DOCUMENT SOURCE

Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-03 09:11 @216.73.216.239
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!