LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

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 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.

INSTALL

sudo apt install netpbm
copy
sudo dnf install netpbm
copy
sudo pacman -S netpbm
copy
sudo apk add netpbm
copy
sudo zypper install netpbm
copy
brew install netpbm
copy
nix profile install nixpkgs#netpbm
copy

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid