LinuxCommandLibrary

icontopbm

Convert X Window System icon files to PBM

TLDR

View documentation for the current command

$ tldr sunicontopnm
copy

SYNOPSIS

icontopbm [-icon|-mask] [iconfile]

PARAMETERS

-icon
    Output PBM from icon pixels (default).

-mask
    Output PBM from mask pixels.

DESCRIPTION

The icontopbm command is part of the Netpbm graphics toolkit and converts Sun Microsystems icon files (.icon format) into portable bitmap (PBM) images.

Sun icons consist of a bitmap image and an associated mask, both typically 64x64 pixels, used in early SunOS/X11 environments for window icons and cursors. icontopbm extracts either the icon pixels or the mask pixels into a standard PBM file, which is a plain text or binary bitmap format ideal for further processing with other Netpbm tools.

By default, it outputs the icon image. Use -mask for the transparency mask. Input can come from a file or stdin, making it pipe-friendly (e.g., icontopbm < iconfile.icon > icon.pbm). The resulting PBM can be manipulated (e.g., resized with pbmscale) or converted to other formats like PNG via pnmtopng.

This tool is useful for archiving legacy Sun graphics or integrating them into modern workflows, though the format is obsolete.

CAVEATS

Sun icon format is obsolete (SunOS/X11 era); fixed 64x64 size; no color support (monochrome only). Reads stdin if no iconfile.

INPUT FORMAT

Expects Sun .icon file: header with dimensions (usually 64x64), followed by icon bitmap and mask bitmap data.

OUTPUT

Standard PBM (P1 plain or P4 raw); icon bits are 1=foreground (black), mask defines transparency.

HISTORY

Developed by Jef Poskanzer in 1989 as part of PBMPLUS toolkit; evolved into Netpbm project (1991+), maintained by Netpbm community for portable graphics conversion.

SEE ALSO

pbmtosunicon(1), pbm(5), ppm(5)

Copied to clipboard