LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pgmnorm

Normalize the contrast in a Netpbm image

TLDR

Normalize image contrast
$ pgmnorm [input.pgm] > [output.pgm]
copy
Normalize with custom percentile cutoffs
$ pgmnorm -bpercent [2] -wpercent [1] [input.pgm] > [output.pgm]
copy
Specify exact pixel values for black and white mapping
$ pgmnorm -bvalue [30] -wvalue [220] [input.pgm] > [output.pgm]
copy
Normalize while preserving hues in color images
$ pgmnorm -keephues [input.ppm] > [output.ppm]
copy

SYNOPSIS

pgmnorm [options] [file]

DESCRIPTION

pgmnorm reads a PNM image (PBM, PGM, or PPM), normalizes the contrast by forcing the darkest pixels to black and the lightest pixels to white, and linearly rescales the values in between. It outputs the same kind of image. This is an older name for pnmnorm.By default, the darkest 2 percent of pixels are mapped to black and the lightest 1 percent to white. These thresholds can be changed with -bpercent and -wpercent, or exact cutoff values can be specified with -bvalue and -wvalue. If both percentage and value options are given for the same end, the one producing the least change is used.Part of the Netpbm toolkit.

PARAMETERS

-bpercent n

Percentage of darkest pixels to map to black. Default: 2.
-wpercent n
Percentage of lightest pixels to map to white. Default: 1.
-bvalue n
Exact pixel value to map to black (overrides -bpercent if it produces less change).
-wvalue n
Exact pixel value to map to white (overrides -wpercent if it produces less change).
-keephues
Keep each pixel the same hue; only adjust brightness. Without this, components are normalized independently, which may shift hues.
-brightmax
Use the most intense RGB component as the pixel's brightness instead of luminosity.

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