1Pamlevels User Manual(0) Pamlevels User Manual(0)
2
3
4
6 pamlevels - effect a 'levels' transformation
7
8
10 pamlevels -from1 from1 -to1 to1 -from2 from2 -to2 to2 [-from3 from3
11 -to3 to3] [-linear] [-fitbrightness] [pamfile]
12
13
15 This program is part of Netpbm(1).
16
17 pamlevels reads a Netpbm image from pamfile or standard input, applies
18 a 'levels' transformation, and sends the result to standard output. It
19 finds a unique transformation that maps color from1 to to1, color from2
20 to to2, and-if -from3 and -to3 are supplied-color from3 to to3. Trans‐
21 formations based on two mappings are linear in light intensity and
22 those based on three mappings quadratic. The color-mapping options may
23 be shortened to -f1...-f3 and -t1...-t3.
24
25 Color values have the following format: color[:scale], where color is a
26 Netpbm color specification ⟨libppm.html#colorname⟩ and scale an op‐
27 tional coefficient that is applied to the intensity (i.e. not gamma-ad‐
28 justed) of each RGB component of color.
29
30 When the transformation is linear (i.e. uses two mappings) and pre‐
31 serves zero (i.e. maps black to black), it corresponds to multiplica‐
32 tion of light intensity by a constant and preserves color integrity(1).
33
34
35
37 In the examples below, \ denotes a line continuation:
38
39 To brighten an image by setting a darker white point-
40 pamlevels -f1 black -t1 black \
41 -f2 white:0.9 -t2 white in.ppm > out.ppm
42
43 To adjust the white point-
44 pamlevels -f1 black -t1 black \
45 -f2 rgbi:0.9/0.83/0.80 -t2 white in.ppm > out.ppm
46
47 To set a lighter black point-
48 pamlevels -f1 white:0.06 -t1 black \
49 -f2 white -t2 white in.ppm > out.ppm
50
51 To increase brightness by compression-
52 pamlevels \
53 -f1 black -t1 black -f2 white -t2 white \
54 -f3 white:0.5 -t3 white:0.6 in.ppm > out.ppm
55 The latter tranformation is similar to gamma-correction.
56
57
58
60 In addition to the options common to all programs based on libnetpbm
61 (most notably -quiet, see
62 Common Options ⟨index.html#commonoptions⟩ ), pamlevels recognizes the
63 following command line options:
64
65
66
67 -from1
68
69 -to1
70
71 -from2
72
73 -to2
74
75 -from3
76
77 -to3 These options define the mappings of input colors to output col‐
78 ors that anchor the transformation function. See DESCRIPTION
79 ⟨#description⟩ .
80
81 You must specify at least two of these pairs.
82
83
84 -linear
85 This option tells pamlevels to work with the intensity-linear
86 variation on PPM where the samples are proportional to light in‐
87 tensity, rather than brightness (gamma-adjusted) as in true PPM.
88 The input must be of this form and the pamlevels makes the out‐
89 put of this form.
90
91 Note that the numbers in a color specification like
92 rgbi:0.9/0.83/0.80 are brightness levels (gamma-adjusted) re‐
93 gardless of the input and output format.
94
95 You cannot use this with -fitbrightness because that function is
96 not implemented.
97
98
99 -fitbrightness
100 This option selects a transformation which is not very useful -
101 it is linear or quadratic in brightness rather than light inten‐
102 sity of the pixels. There is no physical basis for doing it
103 this way and the result is normally undesirable.
104
105 Note that many tools other than Netpbm do the transformation
106 this way. One use for this option is simply to demonstrate the
107 poor result of this method.
108
109 One advantage of this transformation is that it is faster, be‐
110 cause the input and output image formats use brightness values.
111 The result is approximately correct.
112
113 You cannot use this with -linear because that function is not
114 implemented.
115
116
117
118
120 pnmnorm(1), pamrecolor(1), pnmgamma(1), pnm(1)
121
122
124 This program was first submitted by Anton Shepelev (an‐
125 ton.txt@gmail.com).
126
127
129 pamlevels was new in Netpbm 10.83 (June 2018).
130
132 This manual page was generated by the Netpbm tool 'makeman' from HTML
133 source. The master documentation is at
134
135 http://netpbm.sourceforge.net/doc/pamlevels.html
136
137netpbm documentation 13 June 2018 Pamlevels User Manual(0)