ppmdither

Reduce colors with dithering patterns

TLDR

Dither image
$ ppmdither [input.ppm] > [output.ppm]
Specify colors per channel
$ ppmdither -red [4] -green [4] -blue [4] [input.ppm] > [output.ppm]
Floyd-Steinberg dithering
$ ppmdither -fs [input.ppm] > [output.ppm]

SYNOPSIS

ppmdither [options] [file]

DESCRIPTION

ppmdither reduces the number of colors in a PPM image using dithering, which simulates unavailable colors by arranging available colors in patterns that appear blended at a distance. The number of levels per color channel can be specified independently for red, green, and blue.The default uses ordered dithering, while the -fs option selects Floyd-Steinberg error diffusion dithering which generally produces higher quality results with less visible patterning. Unlike quantization (ppmquant), dithering does not choose optimal colors but distributes error across neighboring pixels. Part of the Netpbm toolkit.

PARAMETERS

FILE

Input PPM file.
-red N
Red channel levels.
-green N
Green channel levels.
-blue N
Blue channel levels.
-fs
Floyd-Steinberg dithering.

INSTALL

sudo apt install netpbm
sudo dnf install netpbm
sudo pacman -S netpbm
sudo apk add netpbm
sudo zypper install netpbm
brew install netpbm
nix profile install nixpkgs#netpbm

CAVEATS

Different from quantization. Part of Netpbm suite.

HISTORY

ppmdither was created as part of Netpbm for color dithering.

SEE ALSO

ppmquant(1), pnmremap(1), ppm(5)