Debian Codegraph @

upstream/debian-unstable/man1/pamlevels.1

raw
1 \
2 .\" This man page was generated by the Netpbm tool 'makeman' from HTML source.
3 .\" Do not hand-hack it! If you have bug fixes or improvements, please find
4 .\" the corresponding HTML page on the Netpbm website, generate a patch
5 .\" against that, and send it to the Netpbm maintainer.
6 .TH "Pamlevels User Manual" 1 "13 June 2018" "netpbm documentation"
7
8 .SH NAME
9 pamlevels - effect a 'levels' transformation
10
11 .UN synopsis
12 .SH SYNOPSIS
13
14 \fBpamlevels\fP
15 \fB-from1\fP \fIfrom1\fP
16 \fB-to1\fP \fIto1\fP
17 \fB-from2\fP \fIfrom2\fP
18 \fB-to2\fP \fIto2\fP
19 [\fB-from3\fP \fIfrom3\fP
20 \fB-to3\fP \fIto3\fP]
21 [\fB-linear\fP]
22 [\fB-fitbrightness\fP]
23 [\fIpamfile\fP]
24
25 .UN description
26 .SH DESCRIPTION
27 .PP
28 This program is part of
29 .BR "Netpbm" (1)\c
30 \&.
31 .PP
32 \fBpamlevels\fP reads a Netpbm image from \fIpamfile\fP or standard
33 input, applies a 'levels' transformation, and sends the result to
34 standard output. It finds a unique transformation that maps color
35 \fIfrom1\fP to \fIto1\fP, color \fIfrom2\fP to \fIto2\fP,
36 and-if \fB-from3\fP and \fB-to3\fP are supplied-color
37 \fIfrom3\fP to \fIto3\fP. Transformations based on two mappings are linear
38 in light intensity and those based on three mappings quadratic. The
39 color-mapping options may be shortened to \fB-f1\fP...\fB-f3\fP and
40 \fB-t1\fP...\fB-t3\fP.
41 .PP
42 Color values have the following format:
43 \fIcolor\fP[:\fIscale\fP], where \fIcolor\fP is a
44 .UR libppm.html#colorname
45 Netpbm color specification
46 .UE
47 \& and
48 \fIscale\fP an optional coefficient that is applied to the intensity
49 (i.e. \fInot\fP gamma-adjusted) of each RGB component of \fIcolor\fP.
50 .PP
51 When the transformation is linear (i.e. uses two mappings) and preserves
52 zero (i.e. maps black to black), it corresponds to multiplication of light
53 intensity by a constant and preserves
54 .BR "color integrity" (1)\c
55 \&.
56
57
58 .UN examples
59 .SH EXAMPLES
60 In the examples below, \f(CW\e\fP denotes a line continuation:
61 .PP
62 To brighten an image by setting a darker white point-
63 .nf
64 pamlevels -f1 black -t1 black \e
65 -f2 white:0.9 -t2 white in.ppm > out.ppm
66
67 .fi
68 .PP
69 To adjust the white point-
70 .nf
71 pamlevels -f1 black -t1 black \e
72 -f2 rgbi:0.9/0.83/0.80 -t2 white in.ppm > out.ppm
73
74 .fi
75 .PP
76 To set a lighter black point-
77 .nf
78 pamlevels -f1 white:0.06 -t1 black \e
79 -f2 white -t2 white in.ppm > out.ppm
80
81 .fi
82 .PP
83 To increase brightness by compression-
84 .nf
85 pamlevels \e
86 -f1 black -t1 black -f2 white -t2 white \e
87 -f3 white:0.5 -t3 white:0.6 in.ppm > out.ppm
88
89 .fi
90 The latter transformation is similar to gamma-correction.
91
92
93 .UN options
94 .SH OPTIONS
95 .PP
96 In addition to the options common to all programs based on libnetpbm
97 (most notably \fB-quiet\fP, see
98 .UR index.html#commonoptions
99 Common Options
100 .UE
101 \&), \fBpamlevels\fP recognizes the following
102 command line options:
103
104
105 .TP
106 \fB-from1\fP
107 .TP
108 \fB-to1\fP
109 .TP
110 \fB-from2\fP
111 .TP
112 \fB-to2\fP
113 .TP
114 \fB-from3\fP
115 .TP
116 \fB-to3\fP
117 These options define the mappings of input colors to output colors that anchor
118 the transformation function. See
119 .UR #description
120 DESCRIPTION
121 .UE
122 \&.
123 .sp
124 You must specify at least two of these pairs.
125
126 .TP
127 \fB-linear\fP
128 This option tells \fBpamlevels\fP to work with the intensity-linear
129 variation on PPM where the samples are proportional to light intensity, rather
130 than brightness (gamma-adjusted) as in true PPM. The input must be of this
131 form and the \fBpamlevels\fP makes the output of this form.
132 .sp
133 Note that the numbers in a color specification like
134 \fBrgbi:0.9/0.83/0.80\fP are brightness levels (gamma-adjusted) regardless of
135 the input and output format.
136 .sp
137 You cannot use this with \fB-fitbrightness\fP because that function is
138 not implemented.
139
140 .TP
141 \fB-fitbrightness\fP
142 This option selects a transformation which is not very useful - it is
143 linear or quadratic in brightness rather than light intensity of the pixels.
144 There is no physical basis for doing it this way and the result is normally
145 undesirable.
146 .sp
147 Note that many tools other than Netpbm do the transformation this way. One
148 use for this option is simply to demonstrate the poor result of this method.
149 .sp
150 One advantage of this transformation is that it is faster, because the
151 input and output image formats use brightness values. The result is
152 approximately correct.
153 .sp
154 You cannot use this with \fB-linear\fP because that function is not
155 implemented.
156
157
158
159 .UN seealso
160 .SH SEE ALSO
161 .BR "pnmnorm" (1)\c
162 \&,
163 .BR "pamrecolor" (1)\c
164 \&,
165 .BR "pnmgamma" (1)\c
166 \&,
167 .BR "pnm" (1)\c
168 \&
169
170 .UN author
171 .SH AUTHOR
172 .PP
173 This program was first submitted by Anton Shepelev
174 (\[email protected]\fP).
175
176 .UN history
177 .SH HISTORY
178 .PP
179 \fBpamlevels\fP was new in Netpbm 10.83 (June 2018).
180 .SH DOCUMENT SOURCE
181 This manual page was generated by the Netpbm tool 'makeman' from HTML
182 source. The master documentation is at
183 .IP
184 .B http://netpbm.sourceforge.net/doc/pamlevels.html
185 .PP