1Pamlevels User Manual(0)                              Pamlevels User Manual(0)
2
3
4

NAME

6       pamlevels - effect a 'levels' transformation
7
8

SYNOPSIS

10       pamlevels  -from1  from1  -to1  to1 -from2 from2 -to2 to2 [-from3 from3
11       -to3 to3] [-linear] [-fitbrightness] [pamfile]
12
13

DESCRIPTION

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
27       optional  coefficient that is applied to the intensity (i.e. not gamma-
28       adjusted) 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

EXAMPLES

37       In the examples below, \ denotes a line continuation:
38
39       To brighten an image by setting a darker white point- -f2 white:0.9 -t2
40       white in.ppm > out.ppm</pre>
41
42       To adjust the white point-
43       pamlevels -f1 black -t1 black\
44       -f2 rgbi:0.9/0.83/0.80 -t2 white in.ppm > out.ppm</pre>
45
46       To set a lighter black point-
47       -f2 white -t2 white in.ppm > out.ppm</pre>
48
49       To increase brightness by compression-
50       -f1 black -t1 black -f2 white -t2 white \
51       -f3 white:0.5 -t3 white:0.6 in.ppm > out.ppm</pre>
52       The latter tranformation is similar to gamma-correction.
53
54

OPTIONS

56       In  addition  to  the options common to all programs based on libnetpbm
57       (most notably -quiet, see
58        Common Options ⟨index.html#commonoptions⟩ ), pamlevels recognizes  the
59       following command line options:
60
61
62
63       -from1
64
65       -to1
66
67       -from2
68
69       -to2
70
71       -from3
72
73       -to3   These options define the mappings of input colors to output col‐
74              ors that anchor the transformation  function.   See  DESCRIPTION
75              ⟨#description⟩ .
76
77              You must specify at least two of these pairs.
78
79
80       -linear
81              This  option  tells  pamlevels to work with the intensity-linear
82              variation on PPM where the samples  are  proportional  to  light
83              intensity,  rather  than  brightness (gamma-adjusted) as in true
84              PPM.  The input must be of this form and the pamlevels makes the
85              output of this form.
86
87              Note   that   the   numbers   in   a  color  specification  like
88              rgbi:0.9/0.83/0.80  are   brightness   levels   (gamma-adjusted)
89              regardless of the input and output format.
90
91              You cannot use this with -fitbrightness because that function is
92              not implemented.
93
94
95       -fitbrightness
96              This option selects a transformation which is not very useful  -
97              it is linear or quadratic in brightness rather than light inten‐
98              sity of the pixels.  There is no physical  basis  for  doing  it
99              this way and the result is normally undesirable.
100
101              Note  that  many  tools  other than Netpbm do the transformation
102              this way.  One use for this option is simply to demonstrate  the
103              poor result of this method.
104
105              One  advantage  of  this  transformation  is  that it is faster,
106              because the input and output image formats use  brightness  val‐
107              ues.  The result is approximately correct.
108
109              You  cannot  use  this with -linear because that function is not
110              implemented.
111
112
113
114

SEE ALSO

116       pnmnorm(1), pamrecolor(1), pnmgamma(1), pnm(1)
117
118

AUTHOR

120       This    program    was    first    submitted    by    Anton    Shepelev
121       (anton.txt@gmail.com).
122
123

HISTORY

125       pamlevels was new in Netpbm 10.83 (June 2018).
126

DOCUMENT SOURCE

128       This  manual  page was generated by the Netpbm tool 'makeman' from HTML
129       source.  The master documentation is at
130
131              http://netpbm.sourceforge.net/doc/pamlevels.html
132
133netpbm documentation             13 June 2018         Pamlevels User Manual(0)
Impressum