11# Dither - Color Quantization and Dithering
22
33This is a small program dedicated to reducing the number of colors in an
4- image. It operates with files in binary PPM format ([ Portable PixMap ] [ ppm ] ),
5- and features automatic palette generation (using a median-cut algorithm) and
6- dithering implemented with the Floyd-Steinberg method.
4+ image. It operates with files in PNG or binary PPM format ([ Portable
5+ PixMap ] [ ppm ] ), and features automatic palette generation (using a median-cut
6+ algorithm) and dithering implemented with the Floyd-Steinberg method.
77
88## Installing
99
10- #### On macOS with [ Homebrew] [ brew ]
10+ #### On macOS with [ Homebrew] [ brw ]
1111
1212 $ brew install tessarin/core/dither
1313
1414#### Manual Installation
1515
16- Running ` make ` will compile the program and generate the documentation
17- (requires Perl). To install, move the executable and manual file to the
18- appropriate directories.
16+ First, install [ ` libpng ` ] [ lpg ] . Running ` make ` will then compile the program
17+ and generate the documentation (requires Perl). To install, move the
18+ executable and manual files to appropriate directories in your system .
1919
2020 $ make
2121 $ mv dither ~/bin
2222 $ mv dither.1 ~/man/man1
2323
24- Individual targets can also be specified for only compiling or generating the
25- manual page:
24+ Individual targets can also be specified to only compile the program or to
25+ generate the manual page:
2626
2727 $ make dither
2828 $ make doc
@@ -47,6 +47,32 @@ processing an image. Other possible palettes include:
4747Dithering on the final image can be disabled and the program can also be used
4848just to generate a palette.
4949
50+ ## Samples
51+
52+ #### Automatic Palette
53+
54+ $ dither -p auto.32 bird-original.png bird-auto.32.png
55+
56+ ![ original bird] ( samples/bird-original.png )
57+ ![ generated bird] ( samples/bird-auto.32.png )
58+
59+ #### 1-bit Black & White
60+
61+ $ dither -p bw flower-original.png flower-bw.png
62+
63+ ![ original flower] ( samples/flower-original.png )
64+ ![ generated flower] ( samples/flower-bw.png )
65+
66+ #### 50% Gray Test
67+
68+ Generates a perfect checkerboard pattern.
69+
70+ $ dither -p bw gray-original.png gray-dithered.png
71+
72+ ![ original gray] ( samples/gray-original.png )
73+ ![ dithered gray] ( samples/gray-dithered.png )
74+
5075 [ ppm ] : https://en.wikipedia.org/wiki/Netpbm_format
51- [ brew ] : https://brew.sh
76+ [ brw ] : https://brew.sh
77+ [ lpg ] : http://www.libpng.org/pub/png/libpng.html
5278 [ man ] : dither.pod
0 commit comments