summaryrefslogtreecommitdiff
path: root/www/api/enhance.html
blob: 65e5ffb22e764f97b21817003feb45bd92f5ac6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta content="en" name="language">
	<title>enhance</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link media="screen" href="../docutils-api.css" type="text/css" rel="stylesheet">

</head>

<body>

<div class="banner">
<img src="../images/gm-107x76.png" alt="GraphicMagick logo" width="107" height="76" />
<span class="title">GraphicsMagick</span>
<form action="http://www.google.com/search">
  <input type="hidden" name="domains" value="www.graphicsmagick.org" />
  <input type="hidden" name="sitesearch" value="www.graphicsmagick.org" />
<span class="nowrap"><input type="text" name="q" size="25" maxlength="255" />&nbsp;<input type="submit" name="sa" value="Search" /></span>
</form>
</div>


<div class="navmenu">
<ul>
  <li><a href="../index.html">Home</a></li>
  <li><a href="../project.html">Project</a></li>
  <li><a href="../download.html">Download</a></li>
  <li><a href="../README.html">Install</a></li>
  <li><a href="../Hg.html">Source</a></li>
  <li><a href="../NEWS.html">News</a> </li>
  <li><a href="../utilities.html">Utilities</a></li>
  <li><a href="../programming.html">Programming</a></li>
  <li><a href="../reference.html">Reference</a></li>
</ul>
</div>

<div class="document" id="enhance">
<h1 class="title">enhance</h1>
<p class="subtitle" id="methods-to-enhance-or-adjust-an-image">Methods to enhance or adjust an image</p>
<div class="contents topic" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#contrastimage" id="id15">ContrastImage</a></p></li>
<li><p><a class="reference internal" href="#equalizeimage" id="id16">EqualizeImage</a></p></li>
<li><p><a class="reference internal" href="#gammaimage" id="id17">GammaImage</a></p></li>
<li><p><a class="reference internal" href="#levelimage" id="id18">LevelImage</a></p></li>
<li><p><a class="reference internal" href="#levelimagechannel" id="id19">LevelImageChannel</a></p></li>
<li><p><a class="reference internal" href="#modulateimage" id="id20">ModulateImage</a></p></li>
<li><p><a class="reference internal" href="#negateimage" id="id21">NegateImage</a></p></li>
<li><p><a class="reference internal" href="#normalizeimage" id="id22">NormalizeImage</a></p></li>
</ul>
</div>
<div class="section" id="contrastimage">
<h1><a class="toc-backref" href="#id15">ContrastImage</a></h1>
<div class="section" id="synopsis">
<h2>Synopsis</h2>
<pre class="literal-block">unsigned int ContrastImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const unsigned int sharpen );</pre>
</div>
<div class="section" id="description">
<h2>Description</h2>
<p>ContrastImage() enhances the intensity differences between the lighter and
darker elements of the image.  Set sharpen to a value other than 0 to
increase the image contrast otherwise the contrast is reduced.</p>
<p>The format of the ContrastImage method is:</p>
<pre class="literal-block">unsigned int ContrastImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const unsigned int sharpen );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>sharpen:</dt>
<dd><p>Increase or decrease image contrast.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="equalizeimage">
<h1><a class="toc-backref" href="#id16">EqualizeImage</a></h1>
<div class="section" id="id1">
<h2>Synopsis</h2>
<pre class="literal-block">unsigned int EqualizeImage( <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
</div>
<div class="section" id="id2">
<h2>Description</h2>
<p>EqualizeImage() applies a histogram equalization to the image.</p>
<p>The format of the EqualizeImage method is:</p>
<pre class="literal-block">unsigned int EqualizeImage( <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="gammaimage">
<h1><a class="toc-backref" href="#id17">GammaImage</a></h1>
<div class="section" id="id3">
<h2>Synopsis</h2>
<pre class="literal-block">MagickPassFail GammaImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *level );</pre>
</div>
<div class="section" id="id4">
<h2>Description</h2>
<p>Use GammaImage() to gamma-correct an image.  The same image viewed on
different devices will have perceptual differences in the way the
image's intensities are represented on the screen.  Specify individual
gamma levels for the red, green, and blue channels (e.g. &quot;1.0,2.2,0.45&quot;),
or adjust all three with a single gamma parameter.  Values typically range
from 0.45 to 2.6.</p>
<p>You can also reduce the influence of a particular channel with a gamma
value of 0.</p>
<p>The format of the GammaImage method is:</p>
<pre class="literal-block">MagickPassFail GammaImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *level );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>level:</dt>
<dd><p>Define the level of gamma correction.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="levelimage">
<h1><a class="toc-backref" href="#id18">LevelImage</a></h1>
<div class="section" id="id5">
<h2>Synopsis</h2>
<pre class="literal-block">unsigned int LevelImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *level );</pre>
</div>
<div class="section" id="id6">
<h2>Description</h2>
<p>LevelImage() adjusts the levels of an image by scaling the colors falling
between specified white and black points to the full available quantum
range. The parameters provided represent the black, mid (gamma), and white
points. The black point specifies the darkest color in the image. Colors
darker than the black point are set to zero. Mid point specifies a gamma
correction to apply to the image.  White point specifies the lightest color
in the image. Colors brighter than the white point are set to the maximum
quantum value.</p>
<p>The format of the LevelImage method is:</p>
<pre class="literal-block">unsigned int LevelImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *level );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>levels:</dt>
<dd><p>Specify the levels as a string of the form &quot;black/mid/white&quot;
(e.g. &quot;10,1.0,65000) where black and white have the range of 0-MaxRGB,
and mid has the range 0-10.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="levelimagechannel">
<h1><a class="toc-backref" href="#id19">LevelImageChannel</a></h1>
<div class="section" id="id7">
<h2>Synopsis</h2>
<pre class="literal-block">MagickPassFail LevelImageChannel( <a class="reference external" href="../api/types.html#image">Image</a> *image, const <a class="reference external" href="../api/types.html#channeltype">ChannelType</a> channel,
                                  const double black_point, const double mid_point,
                                  const double white_point );</pre>
</div>
<div class="section" id="id8">
<h2>Description</h2>
<p>LevelImageChannel() adjusts the levels of one or more channels by
scaling the colors falling between specified white and black points to
the full available quantum range. The parameters provided represent the
black, mid (gamma), and white points.  The black point specifies the
darkest color in the image. Colors darker than the black point are set to
zero. Mid point specifies a gamma correction to apply to the image.
White point specifies the lightest color in the image.  Colors brighter
than the white point are set to the maximum quantum value.</p>
<p>The format of the LevelImage method is:</p>
<pre class="literal-block">MagickPassFail LevelImageChannel( <a class="reference external" href="../api/types.html#image">Image</a> *image, const <a class="reference external" href="../api/types.html#channeltype">ChannelType</a> channel,
                                  const double black_point, const double mid_point,
                                  const double white_point );</pre>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>channel:</dt>
<dd><p>Identify which channel to level: Red, Cyan, Green, Magenta,
Blue, Yellow, Opacity, or All.</p>
</dd>
<dt>black_point, mid_point, white_point:</dt>
<dd><p>Specify the levels where the black
and white points have the range of 0-MaxRGB, and mid has the range 0-10.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="modulateimage">
<h1><a class="toc-backref" href="#id20">ModulateImage</a></h1>
<div class="section" id="id9">
<h2>Synopsis</h2>
<pre class="literal-block">unsigned int ModulateImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *modulate );</pre>
</div>
<div class="section" id="id10">
<h2>Description</h2>
<p>ModulateImage() lets you control the brightness, saturation, and hue
of an image.  Modulate represents the brightness, saturation, and hue
as one parameter (e.g. 90,150,100).</p>
<p>The format of the ModulateImage method is:</p>
<pre class="literal-block">unsigned int ModulateImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *modulate );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>modulate:</dt>
<dd><p>Define the percent change in brightness, saturation, and
hue.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="negateimage">
<h1><a class="toc-backref" href="#id21">NegateImage</a></h1>
<div class="section" id="id11">
<h2>Synopsis</h2>
<pre class="literal-block">unsigned int NegateImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const unsigned int grayscale );</pre>
</div>
<div class="section" id="id12">
<h2>Description</h2>
<p>Method NegateImage negates the colors in the reference image.  The
Grayscale option means that only grayscale values within the image are
negated.</p>
<p>The format of the NegateImage method is:</p>
<pre class="literal-block">unsigned int NegateImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, const unsigned int grayscale );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="normalizeimage">
<h1><a class="toc-backref" href="#id22">NormalizeImage</a></h1>
<div class="section" id="id13">
<h2>Synopsis</h2>
<pre class="literal-block">unsigned int NormalizeImage( <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
</div>
<div class="section" id="id14">
<h2>Description</h2>
<p>The NormalizeImage() method enhances the contrast of a color image by
adjusting the pixels color to span the entire range of colors available.</p>
<p>The format of the NormalizeImage method is:</p>
<pre class="literal-block">unsigned int NormalizeImage( <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
</dl>
</div>
</div>
</div>


<hr class="docutils">
<div class="document">
    <p><a href="../Copyright.html">Copyright</a> © GraphicsMagick Group 2002 - 2023<!--SPONSOR_LOGO--></p>
</div>

</div>
</body>
</html>