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: <center> sat = orig *  strength  -  Iorig  *
103       (strength  -  1)  </center> where sat is the saturated sample, orig the
104       original sample, and Iorig the total intensity of the original color.
105
106       The method is also related to color integrity because both  its  opera‐
107       tions are part of that concept: multiplication of component intensities
108       by the same quotient is an important operation because changes  bright‐
109       ness  but  keeps  color balance, and subtraction of a constant from all
110       component intensities is described by the inventor of  color  integrity
111       as 'subtraction of white.'
112
113       This  procedure  may  produce  both  negative  and over-unity component
114       intensities.  For such samples, pamaltsat decreases the strength to the
115       highest value that keeps the resulting color in range.
116
117       This method was invented by Anton Shepelev.
118
119
120

OPTIONS

122       -method method
123              specifies the saturation method to use:
124
125
126              The default is spectrum
127
128
129       -strength strength
130              This specifies a real nonnegative factor whereby to modify satu‐
131              ration.  A value greater than unity  will  increase  saturation,
132              whereas  a  value  less  than unity will decrease it. Unity will
133              leave the image unchanged, and zero will produce greyscale  out‐
134              put according to Rec 709.
135
136              pamaltsat  preserves the total intensity of each pixel and never
137              affects neutral gray pixels.
138
139              This option is mandatory.
140
141
142       -linear
143              This tells pamaltsat that  the  input  is  the  intensity-linear
144              variation of a Netpbm image forat, in which the samples are pro‐
145              portional to light intensity rather than to brightness, as  they
146              are in true-or gamma-adjusted- Netpbm image formats.
147
148
149

USAGE NOTES

151       Since  pamaltsat  does not affect neutral colors, you should adjust the
152       color balance before saturation. You can do this with pamlevels.
153
154
155

EXTENSIBILITY

157       pamaltsat is written with an eye to extending it  with  new  saturation
158       methods,  which  programmers  are  welcome  to  contribute.   The  only
159       requirement is that every new method depend on a single strength param‐
160       eter  with  the  semantics  described  under the -strength command-line
161       option.
162
163
164

SEE ALSO

166       pambrighten(1), ppmflash(1),
167
168
169

AUTHOR

171       This    program    was    first    submitted    by    Anton    Shepelev
172       (anton.txt@gmail.com).
173
174

HISTORY

176       pamaltsat was new in Netpbm 10.84 (September 2018).
177
178
179

Table Of Contents

181       ·
182
183              SYNOPSIS ⟨#synopsis⟩
184
185       ·
186
187              DESCRIPTION ⟨#description⟩
188
189       ·
190
191              EXAMPLES ⟨#examples⟩
192
193       ·
194
195              SATURATION METHODS ⟨#saturation_methods⟩
196
197       ·
198
199              OPTIONS ⟨#options⟩
200
201       ·
202
203              USAGE NOTES ⟨#usage_notes⟩
204
205       ·
206
207              EXTENSIBILITY ⟨#extensibility⟩
208
209       ·
210
211              SEE ALSO ⟨#seealso⟩
212
213       ·
214
215              AUTHOR ⟨#author⟩
216
217       ·
218
219              HISTORY ⟨#history⟩
220

DOCUMENT SOURCE

222       This  manual  page was generated by the Netpbm tool 'makeman' from HTML
223       source.  The master documentation is at
224
225              http://netpbm.sourceforge.net/doc/pamaltsat.html
226
227netpbm documentation           14 September 2018      Pamaltsat User Manual(0)
Impressum