LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pnminvert

Invert colors of PNM images

TLDR

Invert image colors
$ pnminvert [input.pnm] > [output.pnm]
copy
Invert from stdin
$ cat [image.pnm] | pnminvert > [output.pnm]
copy

SYNOPSIS

pnminvert [file]

DESCRIPTION

pnminvert produces a photographic negative of a PNM image by inverting all pixel values. Each sample value is replaced with the maximum value minus the original value, effectively swapping light and dark.The tool works with all PNM types: PBM (black/white bits are flipped), PGM (grayscale values are inverted), and PPM (each color channel is independently inverted). If no file is given, input is read from stdin. Output is always written to stdout.Part of the Netpbm toolkit. The more general paminvert supersedes this tool and handles PAM images as well.

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

`pnminvert` has no options of its own beyond the common libnetpbm options. Output must be redirected to a file; it is always written to stdout.

HISTORY

pnminvert was created as part of the Netpbm package for portable bitmap image manipulation.

SEE ALSO

Copied to clipboard
Kai