LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

ppmdist

Map PPM colors to evenly distributed grayscale levels

TLDR

Sort by intensity and map to grayscale
$ ppmdist -intensity [input.ppm] > [output.pgm]
copy
Sort by frequency and map to grayscale
$ ppmdist -frequency [input.ppm] > [output.pgm]
copy

SYNOPSIS

ppmdist [-intensity | -frequency] [ppmfile]

DESCRIPTION

ppmdist reads a PPM image and produces a PGM output with evenly distributed gray levels. An input of n colors produces n gray levels, maximizing contrast in the output. The mapping order is controlled by the -intensity or -frequency options. Most useful for images with a small number of colors. Part of the Netpbm toolkit.

PARAMETERS

-intensity

Sort input colors by grayscale intensity before mapping to evenly distributed gray levels.
-frequency
Sort input colors by number of occurrences before mapping to evenly distributed gray levels.

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

Only helpful for images with a very small number of colors. Reads from stdin if no file is specified.

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