LinuxCommandLibrary

leaftoppm

Convert Macintosh QuickDraw PICT files to PPM

TLDR

Generate a PPM image file as output for an Interleaf image file as input

$ leaftoppm [path/to/file.pl]
copy

Display version
$ leaftoppm [[-v|-version]]
copy

SYNOPSIS

leaftoppm [-verbose] [leaffile]

PARAMETERS

-verbose
    Prints processing details, such as image dimensions and depth, to standard error.

DESCRIPTION

leaftoppm is a utility from the Netpbm graphics package that reads Silicon Graphics (SGI) Leaf format raster files and converts them to Portable Pixmap (PPM) format or the appropriate Netpbm variant (PBM for monochrome, PGM for grayscale). Leaf, also called IRIS Leaf, is a simple legacy format from SGI workstations used for screen captures and basic image storage. It consists of a fixed 32-byte header specifying dimensions, bit depth, and colormap info, followed by raw pixel data.

The command supports input depths of 1-bit (monochrome), 8-bit (grayscale), 24-bit (RGB), and 32-bit (RGBA). It automatically maps colormaps for indexed images and handles byte order for big-endian SGI files. Output is written to stdout, enabling easy piping to other tools like pnmscale for resizing or ppmtopng for PNG conversion.

Ideal for archiving or processing old SGI dumps, leaftoppm integrates into Netpbm workflows for batch conversion. No image compression or advanced features; it's a lightweight, lossless converter focused on format translation. Run without arguments to read from stdin, perfect for scripts handling piped data from archives.

CAVEATS

Supports only 1-, 8-, 24-, and 32-bit depths; invalid headers produce errors or garbage. Big-endian input assumed; no alpha channel preservation in 32-bit mode.

EXAMPLE

leaftoppm screen.leaf > screen.ppm

pnmarith - overlay.ppm | leaftoppm > combined.ppm

HEADER DETAILS

Leaf header: bytes 0-3 width, 4-7 height, 8-11 depth, 12-15 colormap type; expects SGI byte order.

HISTORY

Part of Netpbm suite, originally written by Jef Poskanzer in early 1990s to support SGI IRIS workstation formats during Unix graphics boom. Evolved with Netpbm releases for broader PNM compatibility.

SEE ALSO

ppm(5), pgm(5), pbm(5), pnmtopnm(1), sgitoppm(1), ppmtoleaf(1)

Copied to clipboard