rawtopgm
Convert raw grayscale data to PGM format
TLDR
Convert raw grayscale to PGM
$ rawtopgm [width] [height] [input.raw] > [output.pgm]
Convert with header bytes to skip$ rawtopgm -headerskip [512] [width] [height] [input.raw] > [output.pgm]
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 the first BYTES bytes of the input before reading pixel data (for files with proprietary headers).-rowskip BYTES
Skip BYTES at the end of each scanline (e.g., padding to a row stride).-bpp N
Bytes per pixel: 1 (default, 8-bit) or 2 (16-bit big-endian samples).-littleendian
When -bpp 2, interpret 16-bit samples as little-endian.-maxval N
Override the maxval written to the output PGM (default 255, or 65535 when -bpp 2).-topbottom
Treat row 0 as the top of the image (default; pair with -bottomtop to flip).-bottomtop
Treat row 0 as the bottom of the image.
