version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
ppmquant |
|
|
2 |
!!!ppmquant |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
REFERENCES |
|
|
7 |
SEE ALSO |
|
|
8 |
AUTHOR |
|
|
9 |
---- |
|
|
10 |
!!NAME |
|
|
11 |
|
|
|
12 |
|
|
|
13 |
ppmquant - quantize the colors in a portable pixmap down to a specified number |
|
|
14 |
!!SYNOPSIS |
|
|
15 |
|
|
|
16 |
|
|
|
17 |
__ppmquant__ [[__-floyd__|__-fs__] ''ncolors'' |
|
|
18 |
[[''ppmfile'']__ |
|
|
19 |
ppmquant__ [[__-floyd__|__-fs__] __-map__ |
|
|
20 |
''mapfile'' [[''ppmfile''] |
|
|
21 |
!!DESCRIPTION |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
Reads a portable pixmap as input. Chooses ''ncolors'' |
|
|
25 |
colors to best represent the image, maps the existing colors |
|
|
26 |
to the new ones, and writes a portable pixmap as |
|
|
27 |
output. |
|
|
28 |
|
|
|
29 |
|
|
|
30 |
The quantization method is Heckbert's |
|
|
31 |
|
|
|
32 |
|
|
|
33 |
Alternately, you can skip the color-choosing step by |
|
|
34 |
specifying your own set of colors with the __-map__ flag. |
|
|
35 |
The ''mapfile'' is just a ''ppm'' file; it can be any |
|
|
36 |
shape, all that matters is the colors in it. For instance, |
|
|
37 |
to quantize down to the 8-color IBM TTL color set, you might |
|
|
38 |
use: |
|
|
39 |
|
|
|
40 |
|
|
|
41 |
P3 |
|
|
42 |
8 1 |
|
|
43 |
255 |
|
|
44 |
0 0 0 |
|
|
45 |
255 0 0 |
|
|
46 |
0 255 0 |
|
|
47 |
0 0 255 |
|
|
48 |
255 255 0 |
|
|
49 |
255 0 255 |
|
|
50 |
0 255 255 |
|
|
51 |
255 255 255 |
|
|
52 |
If you want to quantize one pixmap to use the colors in another one, just use the second one as the mapfile. You don't have to reduce it down to only one pixel of each color, just use it as is. |
|
|
53 |
|
|
|
54 |
|
|
|
55 |
The __-floyd__/__-fs__ flag enables a Floyd-Steinberg |
|
|
56 |
error diffusion step. Floyd-Steinberg gives vastly better |
|
|
57 |
results on images where the unmodified quantization has |
|
|
58 |
banding or other artifacts, especially when going to a small |
|
|
59 |
number of colors such as the above IBM set. However, it does |
|
|
60 |
take substantially more CPU time, so the default is |
|
|
61 |
off. |
|
|
62 |
|
|
|
63 |
|
|
|
64 |
All flags can be abbreviated to their shortest unique |
|
|
65 |
prefix. |
|
|
66 |
!!REFERENCES |
|
|
67 |
|
|
|
68 |
|
|
|
69 |
!!SEE ALSO |
|
|
70 |
|
|
|
71 |
|
|
|
72 |
ppmquantall(1), pnmdepth(1), ppmdither(1), |
|
|
73 |
ppm(5) |
|
|
74 |
!!AUTHOR |
|
|
75 |
|
|
|
76 |
|
|
|
77 |
Copyright (C) 1989, 1991 by Jef Poskanzer. |
|
|
78 |
---- |