PAMTOWINICON(1)
π pamtowinicon β the Netpbm user manual, bestie edition π
okay so quick vibe check: this is pamtowinicon, a General Commands Manual page from the Netpbm user manual family. It's a section 1 manpage, it's iconic, and it turns your PAM pics into Windows icons. Let's get into it β¨
πΈ NAME πΈ
pamtowinicon β convert Netpbm PAM images to a Microsoft Windows icon file π
π¦ SYNOPSIS π¦
pamtowinicon [-pngthreshold=threshold] [-truetransparent] [-verbose]
[pam_file]
okay bestie, housekeeping rules first, no cap:
- all options can be abbreviated to their shortest unique prefix β yes, just type the beginning, it'll figure it out β¨
- you may use two hyphens instead of one to designate an option
- you may use either white space or equals signs between an option name and its value
π DESCRIPTION π
So real talk β this program is part of Netpbm(1). π«Ά
pamtowinicon reads an RGB_ALPHA Netpbm PAM file and converts it into a Microsoft Windows icon file. Glow-up complete. π
The output goes to Standard Output. Every time. That's the assignment.
The input is a multi-image PAM file β and here's the slay part: each image becomes an icon in the output file. So if your images are scattered across multiple files, you can literally just cat them together and pass the result to pamtowinicon. Iconic behaviour, zero effort. π
β¨ OPTIONS β¨
On top of the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), pamtowinicon recognizes the following command line options:
-pngthreshold=thresholdβ this one is the main character ngl.pamtowiniconencodes images with resolutions above or equalthresholdbythresholdas PNG by runningpnmtopng(1). Every other image? It encodes using the more traditional BMP format. Alsoooo, heads up bestie: when the program uses PNG encoding on a 5-channel PAM with a separate AND mask (see below), it discards the AND mask. Why? Because PNG has always had the ability to specify transparency, so the Windows icon format doesn't provide for a separate AND mask when the icon is encoded in PNG. The default value forthresholdis128.-truetransparentβ makes all pixels outside the opaque area black, avoiding inversion and other effects on the background of the image (seeWindows Icons(1)). Clean edges, no weird ghosting. π-verboseβ print more messages. It's giving β¨chattyβ¨.
π IMAGES π
pamtowinicon reads a (multi-image) Netpbm PAM file as input and outputs a single Windows icon file containing those images.
The images in the icon file are in the same order as in the PAM input. No shuffling, no chaos, we're organised here. ποΈ
π PAM Input π
Here's how pamtowinicon interprets the PAM images, based on the number of channels:
1β fully opaque grayscale image2β grayscale image with transparency channel3β fully opaque color image4β color image with transparency channel5β color image with transparency channel and additional AND mask
fr fr, the tuple types of the PAMs are irrelevant. Don't stress about them.
π« AND Mask π«
The so-called "AND mask" is a special feature of Microsoft Windows icons. It is required for all BMP encoded images. At first sight it looks like a 1-bit transparency channel, but bestie it's doing so much more β it's also used for e.g. shading the icon while dragging. See Windows Icons(1) for the details. π
Two scenarios, keep up:
- If there is no explicit AND mask, but there is transparency data in the input image,
pamtowiniconsets the AND mask to opaque where the sample in the transparency channel is belowmaxval, and to transparent everywhere else. - If no transparency data is present in the input image,
pamtowiniconassumes 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. Efficient queen. π
But ngl, pamtowinicon generates neither 16-bit BI_RGB nor BI_BITFIELDS BMP encoded images β even if the maxval of the input PAM is not 255. That's just how it is, don't come for her.
π¦ SEE ALSO π¦
winicontopam(1)ppmtowinicon(1)pam(1)Windows Icons(1)
For information on the PNG format, see http://schaik.com/png π
π HISTORY π
pamtowinicon was new in Netpbm 10.63 (June 2013). It obsoleted ppmtowinicon by providing more function and conforming better to Netpbm conventions. She really said "out with the old" π
β¨
π 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
and that's the whole page bestie!! π«Ά this documentation was brought to you by netpbm documentation, dated 12 April 2013, for the Pamtowinicon User Manual (section 1). periodt. πβ¨π
π¦ where this page comes from
- debian trixie: netpbm 2:11.10.02-1 Β· MIT
- ubuntu resolute: netpbm 2:11.10.02-1build1 Β· MIT
- ubuntu stonking: netpbm 2:11.13.03+ds-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms