21 lines
575 B
Plaintext
21 lines
575 B
Plaintext
Simple implementation of the Floyd-Steinberg dithering algorithm.
|
|
|
|
Usage: dither < input.ppm > output.ppm
|
|
|
|
dither only accepts PPM images (P3). It outputs in the same format.
|
|
|
|
You can easily convert images to PPM format for processing with ImageMagick:
|
|
|
|
$ convert in.png -compress none in.ppm
|
|
|
|
This also works for other formats, like jpeg.
|
|
|
|
I've had problems converting back to PNG from PPM with ImageMagick though. For
|
|
that, I recommend using ffmpeg:
|
|
|
|
$ ffmpeg -i out.ppm out.png
|
|
|
|
|
|
Known errors:
|
|
The program seems to be broken for many images, causing a segmentation fault.
|