LinuxCommandLibrary

rawtopgm

Convert raw grayscale data to PGM format

TLDR

Convert raw grayscale to PGM

$ rawtopgm [width] [height] [input.raw] > [output.pgm]
copy
Convert with header bytes to skip
$ rawtopgm -headerskip [512] [width] [height] [input.raw] > [output.pgm]
copy

SYNOPSIS

rawtopgm [options] width height [file]

DESCRIPTION

rawtopgm converts raw grayscale byte data into Portable Graymap (PGM) format by interpreting a stream of pixel values according to specified image dimensions. Since raw data contains no metadata, the width and height must be provided as arguments so the tool knows how to arrange the bytes into a proper image grid.
The -headerskip option allows skipping file headers that precede the actual pixel data, and -bpp handles 16-bit samples for higher dynamic range images. It is part of the Netpbm image processing toolkit.

PARAMETERS

width

Image width in pixels.
height
Image height in pixels.
-headerskip bytes
Skip header bytes.
-maxval n
Maximum gray value.
-bpp n
Bytes per pixel (1 or 2).

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community