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

NAME

6       pamaltsat  -  increase or decrease the saturation of an image using one
7       of several alternative methods.
8
9

SYNOPSIS

11       pamaltsat [-method name] [-strength number] [-linear] [infile]
12
13

DESCRIPTION

15       This program is part of Netpbm(1).
16
17       pamaltsat decreases or increases the saturation of a  Netpbm  image  by
18       one of various non-standard (alternative) methods.
19
20       The  input is a Netpbm image from Standard Input or a file named by the
21       arguments.  The output is a Netpbm image in the same format written  to
22       Standard Output.
23
24       The  most conventional way to change the saturation of an image is what
25       pambrighten does.
26
27
28

EXAMPLES

30       To increase saturation by a factor of 2.1 using the logarithmic method:
31
32            pamaltsat -method log -strength 2.1 test.ppm
33
34       To convert a color image to grayscale:
35
36           pamaltsat -strength 0 test.ppm
37
38
39

SATURATION METHODS

41       The following saturation methods are available.
42
43
44   Logarithmic Method
45       This saturation model is inspired by the concept of color integrity(1),
46       which works with color in terms of intensity ratios, where intensity is
47       a        value        of        the         luminosity         function
48https://en.wikipedia.org/wiki/Luminosity_function⟩   ,   rather   than
49       brightness, or the numerical value of the sample  in  the  image  file.
50       From  this viewpoint, it is natural to define the saturation of a color
51       as the ratio of maximum and minimum intensities of its  primary  compo‐
52       nents.  In  order, however, to make saturation an additive value and to
53       endow the -strength parameter with the semantics of a multiplier, it is
54       convenient  to operate on the logarithm of that ratio.  The addition of
55       such saturations acquires physical  sense,  and  multiplication  corre‐
56       sponds to the raising of intensity to the power of the multiplier.
57
58       With  this  method, pamaltsat raises the intensity of each component to
59       the power of the strength value.  Since  the  total  intensity  of  the
60       resulting  color will differ from that of the original, it is necessary
61       to restore the intensity by multiplying the  component  intensities  of
62       the saturated color by the ratio of the intensity of the original color
63       to that of the saturated color.
64
65       Although it is always possible to decrease saturation by any given fac‐
66       tor,  there are two cases where it cannot be increased.  When the total
67       intensity (or brightness) of a color is too high for the desired  satu‐
68       ration,  pamaltsat  applies  the maximum possible saturation that keeps
69       the original intensity.  For example, any color with at least one  com‐
70       ponent  at  the  maxiumum  is already fully saturated.  When one of the
71       primary components is zero, the definition of saturation given above no
72       longer works because of a zero in the denominator.  pamaltsat offers no
73       special treatment of this situation because it does not create  discon‐
74       tinuities  and  therefore  produces  no  visible  defects at reasonable
75       strength levels.  When, however,  strength  approaches  infinity,  each
76       color tends to its primary component with the highest intensity.
77
78       This method was invented by Anton Shepelev.
79
80
81
82   Spectral Method
83       This  is  the default method.  It treats color as a spectrum with three
84       bands: one for the intensity of each primary component.  Since  neutral
85       gray  has  a uniform (constant) spectrum, saturation can be measured as
86       the difference of the spectrum of the  given  color  from  the  uniform
87       spectrum  of the same total intensity.  The spectral method uses one of
88       the simplest measures of such a difference: the difference between  the
89       highest  and  lowest  component intensities, which is an additive value
90       and therefore amenable to  multiplication  with  good  physical  sense.
91       Although  a  complete  hue-saturation  model  can  be dervied from this
92       approach, pamaltsat need not concern itself with it because  it  always
93       preserves both hue and total intensity.
94
95       In order to change saturation, pamaltsat first multiplies the intensity
96       of each component by the  desired  strength.   The  saturation  of  the
97       result  is the strength times the saturation of the original, and like‐
98       wise the total intensity, but it is then restored by subtraction of the
99       neutral gray with a suitable intensity.
100
101       The  effect of this method on each component intensity may be expressed
102       in the following equation:
103       <span style="font-family: monospace">
104           sat = orig * strength - Iorig * (strength - 1)
105       </span>
106       where <span style="font-family: monospace">sat</span> is the  saturated
107       sample,  <span  style="font-family: monospace">orig</span> the original
108       sample, and <span style="font-family: monospace">Iorig</span> the total
109       intensity of the original color.
110
111       The  method  is also related to color integrity because both its opera‐
112       tions are part of that concept: multiplication of component intensities
113       by  the same quotient is an important operation because changes bright‐
114       ness but keeps color balance, and subtraction of a  constant  from  all
115       component  intensities  is described by the inventor of color integrity
116       as 'subtraction of white.'
117
118       This procedure may  produce  both  negative  and  over-unity  component
119       intensities.  For such samples, pamaltsat decreases the strength to the
120       highest value that keeps the resulting color in range.
121
122       This method was invented by Anton Shepelev.
123
124
125

OPTIONS

127       In addition to the options common to all programs  based  on  libnetpbm
128       (most notably -quiet, see
129        Common  Options ⟨index.html#commonoptions⟩ ), pamaltsat recognizes the
130       following command line options:
131
132
133
134       -method method
135              specifies the saturation method to use:
136
137
138              The default is spectrum
139
140
141       -strength strength
142              This specifies a real nonnegative factor whereby to modify satu‐
143              ration.   A  value  greater than unity will increase saturation,
144              whereas a value less than unity will  decrease  it.  Unity  will
145              leave  the image unchanged, and zero will produce greyscale out‐
146              put according to Rec 709.
147
148              pamaltsat preserves the total intensity of each pixel and  never
149              affects neutral gray pixels.
150
151              This option is mandatory.
152
153
154       -linear
155              This  tells  pamaltsat  that  the  input is the intensity-linear
156              variation of a Netpbm image forat, in which the samples are pro‐
157              portional  to light intensity rather than to brightness, as they
158              are in true-or gamma-adjusted- Netpbm image formats.
159
160
161

USAGE NOTES

163       Since pamaltsat does not affect neutral colors, you should  adjust  the
164       color balance before saturation. You can do this with pamlevels.
165
166
167

EXTENSIBILITY

169       pamaltsat  is  written  with an eye to extending it with new saturation
170       methods,  which  programmers  are  welcome  to  contribute.   The  only
171       requirement is that every new method depend on a single strength param‐
172       eter with the semantics  described  under  the  -strength  command-line
173       option.
174
175
176

SEE ALSO

178       pambrighten(1), ppmflash(1),
179
180
181

AUTHOR

183       This    program    was    first    submitted    by    Anton    Shepelev
184       (anton.txt@gmail.com).
185
186

HISTORY

188       pamaltsat was new in Netpbm 10.84 (September 2018).
189
190
191

Table Of Contents

193       ·
194
195              SYNOPSIS ⟨#synopsis⟩
196
197       ·
198
199              DESCRIPTION ⟨#description⟩
200
201       ·
202
203              EXAMPLES ⟨#examples⟩
204
205       ·
206
207              SATURATION METHODS ⟨#saturation_methods⟩
208
209       ·
210
211              OPTIONS ⟨#options⟩
212
213       ·
214
215              USAGE NOTES ⟨#usage_notes⟩
216
217       ·
218
219              EXTENSIBILITY ⟨#extensibility⟩
220
221       ·
222
223              SEE ALSO ⟨#seealso⟩
224
225       ·
226
227              AUTHOR ⟨#author⟩
228
229       ·
230
231              HISTORY ⟨#history⟩
232

DOCUMENT SOURCE

234       This manual page was generated by the Netpbm tool 'makeman'  from  HTML
235       source.  The master documentation is at
236
237              http://netpbm.sourceforge.net/doc/pamaltsat.html
238
239netpbm documentation           14 September 2018      Pamaltsat User Manual(0)
Impressum