LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pnmdepth

Change color depth of PNM images

TLDR

Change image depth
$ pnmdepth [newdepth] [input.pnm] > [output.pnm]
copy
Reduce to 8-bit
$ pnmdepth 255 [input.pnm] > [output.pnm]
copy
Reduce to 4-bit
$ pnmdepth 15 [input.pnm] > [output.pnm]
copy

SYNOPSIS

pnmdepth newmaxval [file]

DESCRIPTION

pnmdepth changes the maximum sample value (color depth) of PNM images by proportionally rescaling all pixel values. For example, converting from maxval 65535 (16-bit) to 255 (8-bit) scales each sample value accordingly.This is useful for reducing file size by lowering bit depth or for ensuring compatibility with tools that expect specific depth values. Part of the Netpbm toolkit; superseded by pamdepth.

PARAMETERS

NEWMAXVAL

New maximum sample value (depth).
FILE
Input PNM file.

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

CAVEATS

Values are scaled proportionally. Part of Netpbm suite.

HISTORY

pnmdepth was created as part of Netpbm for image depth conversion.

SEE ALSO

pamdepth(1), pnm(5), ppmquant(1)

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