LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

paminvert

produces a negative of a PAM or PNM image by inverting all pixel values

TLDR

Invert image colors
$ paminvert [input.pam] > [output.pam]
copy
Invert from pipe
$ cat [image.ppm] | paminvert > [inverted.ppm]
copy

SYNOPSIS

paminvert [pamfile]

DESCRIPTION

paminvert produces a negative of a PAM or PNM image by inverting all pixel values. Each sample value is replaced with maxval minus the sample value.For grayscale, black becomes white and vice versa. For color, each channel is inverted independently.

EXAMPLE

$ # Create negative
paminvert photo.ppm > negative.ppm

# Invert and convert to PNG
paminvert photo.ppm | pnmtopng > negative.png
copy

FORMULA

$ output = maxval - input

For 8-bit (maxval=255):
Black (0)   -> White (255)
White (255) -> Black (0)
Gray (128)  -> Gray (127)
copy

CAVEATS

Simple inversion; not perceptual negative. Alpha channel also inverted if present.

HISTORY

paminvert is part of Netpbm, providing simple image inversion as a fundamental operation.

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