version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
ppmnorm |
|
|
2 |
!!!ppmnorm |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OPTIONS |
|
|
7 |
SEE ALSO |
|
|
8 |
AUTHOR |
|
|
9 |
---- |
|
|
10 |
!!NAME |
|
|
11 |
|
|
|
12 |
|
|
|
13 |
ppmnorm - normalize the contrast in a portable pixmap |
|
|
14 |
!!SYNOPSIS |
|
|
15 |
|
|
|
16 |
|
|
|
17 |
__ppmnorm__ [[__-bpercent__ ''N'' | __-bvalue__ |
|
|
18 |
''N''] [[__-wpercent__ ''N'' | __-wvalue__ |
|
|
19 |
''N''] [[''ppmfile''] |
|
|
20 |
!!DESCRIPTION |
|
|
21 |
|
|
|
22 |
|
|
|
23 |
Reads a portable pixmap as input. Normalizes the contrast by |
|
|
24 |
forcing the lightest pixels to white, the darkest pixels to |
|
|
25 |
black, and linearly rescaling the ones in between; and |
|
|
26 |
produces a portable pixmap as output. |
|
|
27 |
|
|
|
28 |
|
|
|
29 |
Works by computing the realtive grey-level of each pixel |
|
|
30 |
''a'la'' ppmtopgm, and uses those values to scale the RGB |
|
|
31 |
levels. Note that this is different from using pgmnorm on |
|
|
32 |
the individual red, green, and blue greymaps (as produced by |
|
|
33 |
ppmtorgb3) and recombining them. |
|
|
34 |
!!OPTIONS |
|
|
35 |
|
|
|
36 |
|
|
|
37 |
By default, the darkest 2 percent of all pixels are mapped |
|
|
38 |
to black, and the lightest 1 percent are mapped to white. |
|
|
39 |
You can override these percentages by using the |
|
|
40 |
__-bpercent__ and __-wpercent__ flags, or you can |
|
|
41 |
specify the exact pixel values to be mapped by using the |
|
|
42 |
__-bvalue__ and __-wvalue__ flags. Appropriate numbers |
|
|
43 |
for the flags can be gotten from the ''ppmhist'' tool. If |
|
|
44 |
you just want to enhance the contrast, then choose values at |
|
|
45 |
elbows in the histogram; e.g. if value 29 represents 3% of |
|
|
46 |
the image but value 30 represents 20%, choose 30 for |
|
|
47 |
''bvalue''. If you want to lighten the image, then set |
|
|
48 |
''bvalue'' to 0 and just fiddle with ''wvalue''; |
|
|
49 |
similarly, to darken the image, set ''wvalue'' to maxval |
|
|
50 |
and play with ''bvalue''. |
|
|
51 |
|
|
|
52 |
|
|
|
53 |
All flags can be abbreviated to their shortest unique |
|
|
54 |
prefix. |
|
|
55 |
!!SEE ALSO |
|
|
56 |
|
|
|
57 |
|
|
|
58 |
pgmnorm(1), ppmhist(1), ppm(5) |
|
|
59 |
!!AUTHOR |
|
|
60 |
|
|
|
61 |
|
|
|
62 |
Wilson H. Bent. Jr. (whb@usc.edu), heavily based on the |
|
|
63 |
pgmnorm filter by Jef Poskanzer. |
|
|
64 |
---- |