LinuxCommandLibrary

pamnoraw

Convert a PAM image to a PNM image

TLDR

View documentation for the original command

$ tldr pamtopnm
copy

SYNOPSIS

pamnoraw [netpbmfile]

DESCRIPTION

The pamnoraw command is a utility from the Netpbm image processing toolkit. Its primary function is to convert a Netpbm image file from its 'raw' (binary) format into a 'plain' (ASCII) format. Netpbm images encompass various types including Portable Bitmap (PBM), Portable Graymap (PGM), Portable Pixmap (PPM), and Portable Arbitrary Map (PAM).

In the raw format, pixel data is stored as a direct byte stream, which is efficient for storage and processing. Conversely, the plain format represents each pixel value as an ASCII number, often separated by whitespace, making the file human-readable and easier to parse with non-Netpbm specific tools. This transformation increases file size but is beneficial for inspection, debugging, or when compatibility with tools expecting plain ASCII pixel data is required. By default, pamnoraw reads from standard input and writes the converted image to standard output.

CAVEATS

Plain Netpbm files generated by pamnoraw are significantly larger than their raw (binary) counterparts and are slower for image processing applications to read and write. They are primarily intended for human inspection or interoperability with systems that specifically require ASCII numeric pixel data.

INPUT AND OUTPUT

By default, pamnoraw reads the Netpbm image data from standard input (stdin). If an optional netpbmfile is provided as a command-line argument, it reads from that file instead. The converted plain Netpbm image is always written to standard output (stdout).

FORMAT CONVERSION DETAILS

pamnoraw converts the data section of any Netpbm image (PBM, PGM, PPM, PAM) to its plain (ASCII numeric) representation. For PBM, PGM, and PPM, this means converting raw format P4, P5, P6 respectively to plain P1, P2, P3. For PAM, it converts the raw tuple data block to an ASCII representation of the tuple values, while maintaining the PAM header structure.

HISTORY

pamnoraw is a long-standing utility within the Netpbm suite, which evolved from the earlier Pbmplus package. The Netpbm project emphasizes a philosophy of providing many small, specialized tools that can be combined (often via pipelines) to perform complex image manipulations. pamnoraw serves a fundamental role in this ecosystem by enabling easy inspection and manipulation of image data in a human-readable format, reflecting the toolkit's commitment to basic, composable image transformations.

SEE ALSO

pam(1), pamtoraw(1), pnm(5), netpbm(1)

Copied to clipboard