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  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

EXAMPLES

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
44       To adjust the white point-
45           pamlevels -f1 black -t1 black \
46             -f2 rgbi:0.9/0.83/0.80 -t2 white in.ppm > out.ppm
47
48
49       To set a lighter black point-
50           pamlevels -f1 white:0.06 -t1 black \
51             -f2 white -t2 white in.ppm > out.ppm
52
53
54       To increase brightness by compression-
55           pamlevels \
56             -f1 black -t1 black -f2 white -t2 white \
57             -f3 white:0.5 -t3 white:0.6 in.ppm > out.ppm
58
59       The latter tranformation is similar to gamma-correction.
60
61
62

OPTIONS

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

SEE ALSO

124       pnmnorm(1), pamrecolor(1), pnmgamma(1), pnm(1)
125
126

AUTHOR

128       This   program   was   first   submitted   by   Anton   Shepelev   (an‐
129       ton.txt@gmail.com).
130
131

HISTORY

133       pamlevels was new in Netpbm 10.83 (June 2018).
134

DOCUMENT SOURCE

136       This manual page was generated by the Netpbm tool 'makeman'  from  HTML
137       source.  The master documentation is at
138
139              http://netpbm.sourceforge.net/doc/pamlevels.html
140
141netpbm documentation             13 June 2018         Pamlevels User Manual(0)
Impressum