• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2
3
4
5<!DOCTYPE html>
6<html lang="en">
7<head>
8  <meta charset="utf-8"  />
9  <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,shrink-to-fit=no"  />
10  <title>MagickCore, C API: Image Statistics @ ImageMagick</title>
11  <meta name="application-name" content="ImageMagick" />
12  <meta name="description" content="Use ImageMagick® to create, edit, compose, or convert bitmap images. You can resize your image, crop it, change its shades and colors, add captions, among other operations." />
13  <meta name="application-url" content="https://imagemagick.org" />
14  <meta name="generator" content="PHP" />
15  <meta name="keywords" content="magickcore, c, api:, image, statistics, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert" />
16  <meta name="rating" content="GENERAL" />
17  <meta name="robots" content="INDEX, FOLLOW" />
18  <meta name="generator" content="ImageMagick Studio LLC" />
19  <meta name="author" content="ImageMagick Studio LLC" />
20  <meta name="revisit-after" content="2 DAYS" />
21  <meta name="resource-type" content="document" />
22  <meta name="copyright" content="Copyright (c) 1999-2017 ImageMagick Studio LLC" />
23  <meta name="distribution" content="Global" />
24  <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" />
25  <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
26  <link href="statistic.html" rel="canonical" />
27  <link href="../../images/wand.png" rel="icon" />
28  <link href="../../images/wand.ico" rel="shortcut icon" />
29  <link href="../assets/magick.css" rel="stylesheet" />
30</head>
31<body>
32  <header>
33  <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
34    <a class="navbar-brand" href="../../"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../../images/wand.ico"/></a>
35    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsMagick" aria-controls="navbarsMagick" aria-expanded="false" aria-label="Toggle navigation">
36      <span class="navbar-toggler-icon"></span>
37    </button>
38
39    <div class="navbar-collapse collapse" id="navbarsMagick" style="">
40    <ul class="navbar-nav mr-auto">
41      <li class="nav-item ">
42        <a class="nav-link" href="quantize.html">Home <span class="sr-only">(current)</span></a>
43      </li>
44      <li class="nav-item ">
45        <a class="nav-link" href="../../www/download.html">Download</a>
46      </li>
47      <li class="nav-item ">
48        <a class="nav-link" href="../../www/command-line-tools.html">Tools</a>
49      </li>
50      <li class="nav-item ">
51        <a class="nav-link" href="../../www/command-line-processing.html">Command-line</a>
52      </li>
53      <li class="nav-item ">
54        <a class="nav-link" href="../../www/resources.html">Resources</a>
55      </li>
56      <li class="nav-item ">
57        <a class="nav-link" href="../../www/develop.html">Develop</a>
58      </li>
59      <li class="nav-item">
60        <a class="nav-link" target="_blank" href="https://imagemagick.org/discourse-server/">Community</a>
61      </li>
62    </ul>
63    <form class="form-inline my-2 my-lg-0" action="https://imagemagick.org/script/search.php">
64      <input class="form-control mr-sm-2" type="text" name="q" placeholder="Search" aria-label="Search">
65      <button class="btn btn-outline-success my-2 my-sm-0" type="submit" name="sa">Search</button>
66    </form>
67    </div>
68  </nav>
69  <div class="container">
70   <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
71         style="display:block"
72         data-ad-client="ca-pub-3129977114552745"
73         data-ad-slot="6345125851"
74         data-ad-format="auto"></ins>
75    <script>
76      (adsbygoogle = window.adsbygoogle || []).push({});
77    </script>
78
79  </div>
80  </header>
81  <main class="container">
82    <div class="magick-template">
83<div class="magick-header">
84<p class="text-center"><a href="statistic.html#EvaluateImage">EvaluateImage</a> &#8226; <a href="statistic.html#FunctionImage">FunctionImage</a> &#8226; <a href="statistic.html#GetImageEntropy">GetImageEntropy</a> &#8226; <a href="statistic.html#GetImageExtrema">GetImageExtrema</a> &#8226; <a href="statistic.html#GetImageKurtosis">GetImageKurtosis</a> &#8226; <a href="statistic.html#GetImageMean">GetImageMean</a> &#8226; <a href="statistic.html#GetImageMoments">GetImageMoments</a> &#8226; <a href="statistic.html#GetImagePerceptualHash">GetImagePerceptualHash</a> &#8226; <a href="statistic.html#GetImageRange">GetImageRange</a> &#8226; <a href="statistic.html#GetImageStatistics">GetImageStatistics</a> &#8226; <a href="statistic.html#PolynomialImage">PolynomialImage</a> &#8226; <a href="statistic.html#StatisticImage">StatisticImage</a></p>
85
86<h2><a href="../../api/MagickCore/statistic_8c.html" id="EvaluateImage">EvaluateImage</a></h2>
87
88<p>EvaluateImage() applies a value to the image with an arithmetic, relational, or logical operator to an image. Use these operations to lighten or darken an image, to increase or decrease contrast in an image, or to produce the "negative" of an image.</p>
89
90<p>The format of the EvaluateImage method is:</p>
91
92<pre class="text">
93MagickBooleanType EvaluateImage(Image *image,
94  const MagickEvaluateOperator op,const double value,
95  ExceptionInfo *exception)
96MagickBooleanType EvaluateImages(Image *images,
97  const MagickEvaluateOperator op,const double value,
98  ExceptionInfo *exception)
99</pre>
100
101<p>A description of each parameter follows:</p>
102
103<dd>
104</dd>
105
106<dd> </dd>
107<dl class="dl-horizontal">
108<dt>image</dt>
109<dd>the image. </dd>
110
111<dd> </dd>
112<dt>op</dt>
113<dd>A channel op. </dd>
114
115<dd> </dd>
116<dt>value</dt>
117<dd>A value value. </dd>
118
119<dd> </dd>
120<dt>exception</dt>
121<dd>return any errors or warnings in this structure. </dd>
122
123<dd>  </dd>
124</dl>
125<h2><a href="../../api/MagickCore/statistic_8c.html" id="FunctionImage">FunctionImage</a></h2>
126
127<p>FunctionImage() applies a value to the image with an arithmetic, relational, or logical operator to an image. Use these operations to lighten or darken an image, to increase or decrease contrast in an image, or to produce the "negative" of an image.</p>
128
129<p>The format of the FunctionImage method is:</p>
130
131<pre class="text">
132MagickBooleanType FunctionImage(Image *image,
133  const MagickFunction function,const ssize_t number_parameters,
134  const double *parameters,ExceptionInfo *exception)
135</pre>
136
137<p>A description of each parameter follows:</p>
138
139<dd>
140</dd>
141
142<dd> </dd>
143<dl class="dl-horizontal">
144<dt>image</dt>
145<dd>the image. </dd>
146
147<dd> </dd>
148<dt>function</dt>
149<dd>A channel function. </dd>
150
151<dd> </dd>
152<dt>parameters</dt>
153<dd>one or more parameters. </dd>
154
155<dd> </dd>
156<dt>exception</dt>
157<dd>return any errors or warnings in this structure. </dd>
158
159<dd>  </dd>
160</dl>
161<h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageEntropy">GetImageEntropy</a></h2>
162
163<p>GetImageEntropy() returns the entropy of one or more image channels.</p>
164
165<p>The format of the GetImageEntropy method is:</p>
166
167<pre class="text">
168MagickBooleanType GetImageEntropy(const Image *image,double *entropy,
169  ExceptionInfo *exception)
170</pre>
171
172<p>A description of each parameter follows:</p>
173
174<dd>
175</dd>
176
177<dd> </dd>
178<dl class="dl-horizontal">
179<dt>image</dt>
180<dd>the image. </dd>
181
182<dd> </dd>
183<dt>entropy</dt>
184<dd>the average entropy of the selected channels. </dd>
185
186<dd> </dd>
187<dt>exception</dt>
188<dd>return any errors or warnings in this structure. </dd>
189
190<dd>  </dd>
191</dl>
192<h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageExtrema">GetImageExtrema</a></h2>
193
194<p>GetImageExtrema() returns the extrema of one or more image channels.</p>
195
196<p>The format of the GetImageExtrema method is:</p>
197
198<pre class="text">
199MagickBooleanType GetImageExtrema(const Image *image,size_t *minima,
200  size_t *maxima,ExceptionInfo *exception)
201</pre>
202
203<p>A description of each parameter follows:</p>
204
205<dd>
206</dd>
207
208<dd> </dd>
209<dl class="dl-horizontal">
210<dt>image</dt>
211<dd>the image. </dd>
212
213<dd> </dd>
214<dt>minima</dt>
215<dd>the minimum value in the channel. </dd>
216
217<dd> </dd>
218<dt>maxima</dt>
219<dd>the maximum value in the channel. </dd>
220
221<dd> </dd>
222<dt>exception</dt>
223<dd>return any errors or warnings in this structure. </dd>
224
225<dd>  </dd>
226</dl>
227<h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageKurtosis">GetImageKurtosis</a></h2>
228
229<p>GetImageKurtosis() returns the kurtosis and skewness of one or more image channels.</p>
230
231<p>The format of the GetImageKurtosis method is:</p>
232
233<pre class="text">
234MagickBooleanType GetImageKurtosis(const Image *image,double *kurtosis,
235  double *skewness,ExceptionInfo *exception)
236</pre>
237
238<p>A description of each parameter follows:</p>
239
240<dd>
241</dd>
242
243<dd> </dd>
244<dl class="dl-horizontal">
245<dt>image</dt>
246<dd>the image. </dd>
247
248<dd> </dd>
249<dt>kurtosis</dt>
250<dd>the kurtosis of the channel. </dd>
251
252<dd> </dd>
253<dt>skewness</dt>
254<dd>the skewness of the channel. </dd>
255
256<dd> </dd>
257<dt>exception</dt>
258<dd>return any errors or warnings in this structure. </dd>
259
260<dd>  </dd>
261</dl>
262<h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageMean">GetImageMean</a></h2>
263
264<p>GetImageMean() returns the mean and standard deviation of one or more image channels.</p>
265
266<p>The format of the GetImageMean method is:</p>
267
268<pre class="text">
269MagickBooleanType GetImageMean(const Image *image,double *mean,
270  double *standard_deviation,ExceptionInfo *exception)
271</pre>
272
273<p>A description of each parameter follows:</p>
274
275<dd>
276</dd>
277
278<dd> </dd>
279<dl class="dl-horizontal">
280<dt>image</dt>
281<dd>the image. </dd>
282
283<dd> </dd>
284<dt>mean</dt>
285<dd>the average value in the channel. </dd>
286
287<dd> </dd>
288<dt>standard_deviation</dt>
289<dd>the standard deviation of the channel. </dd>
290
291<dd> </dd>
292<dt>exception</dt>
293<dd>return any errors or warnings in this structure. </dd>
294
295<dd>  </dd>
296</dl>
297<h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageMoments">GetImageMoments</a></h2>
298
299<p>GetImageMoments() returns the normalized moments of one or more image channels.</p>
300
301<p>The format of the GetImageMoments method is:</p>
302
303<pre class="text">
304ChannelMoments *GetImageMoments(const Image *image,
305  ExceptionInfo *exception)
306</pre>
307
308<p>A description of each parameter follows:</p>
309
310<dd>
311</dd>
312
313<dd> </dd>
314<dl class="dl-horizontal">
315<dt>image</dt>
316<dd>the image. </dd>
317
318<dd> </dd>
319<dt>exception</dt>
320<dd>return any errors or warnings in this structure. </dd>
321
322<dd>  </dd>
323</dl>
324<h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImagePerceptualHash">GetImagePerceptualHash</a></h2>
325
326<p>GetImagePerceptualHash() returns the perceptual hash of one or more image channels.</p>
327
328<p>The format of the GetImagePerceptualHash method is:</p>
329
330<pre class="text">
331ChannelPerceptualHash *GetImagePerceptualHash(const Image *image,
332  ExceptionInfo *exception)
333</pre>
334
335<p>A description of each parameter follows:</p>
336
337<dd>
338</dd>
339
340<dd> </dd>
341<dl class="dl-horizontal">
342<dt>image</dt>
343<dd>the image. </dd>
344
345<dd> </dd>
346<dt>exception</dt>
347<dd>return any errors or warnings in this structure. </dd>
348
349<dd>  </dd>
350</dl>
351<h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageRange">GetImageRange</a></h2>
352
353<p>GetImageRange() returns the range of one or more image channels.</p>
354
355<p>The format of the GetImageRange method is:</p>
356
357<pre class="text">
358MagickBooleanType GetImageRange(const Image *image,double *minima,
359  double *maxima,ExceptionInfo *exception)
360</pre>
361
362<p>A description of each parameter follows:</p>
363
364<dd>
365</dd>
366
367<dd> </dd>
368<dl class="dl-horizontal">
369<dt>image</dt>
370<dd>the image. </dd>
371
372<dd> </dd>
373<dt>minima</dt>
374<dd>the minimum value in the channel. </dd>
375
376<dd> </dd>
377<dt>maxima</dt>
378<dd>the maximum value in the channel. </dd>
379
380<dd> </dd>
381<dt>exception</dt>
382<dd>return any errors or warnings in this structure. </dd>
383
384<dd>  </dd>
385</dl>
386<h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageStatistics">GetImageStatistics</a></h2>
387
388<p>GetImageStatistics() returns statistics for each channel in the image.  The statistics include the channel depth, its minima, maxima, mean, standard deviation, kurtosis and skewness.  You can access the red channel mean, for example, like this:</p>
389
390<pre class="text">
391channel_statistics=GetImageStatistics(image,exception);
392red_mean=channel_statistics[RedPixelChannel].mean;
393</pre>
394
395<p>Use MagickRelinquishMemory() to free the statistics buffer.</p>
396
397<p>The format of the GetImageStatistics method is:</p>
398
399<pre class="text">
400ChannelStatistics *GetImageStatistics(const Image *image,
401  ExceptionInfo *exception)
402</pre>
403
404<p>A description of each parameter follows:</p>
405
406<dd>
407</dd>
408
409<dd> </dd>
410<dl class="dl-horizontal">
411<dt>image</dt>
412<dd>the image. </dd>
413
414<dd> </dd>
415<dt>exception</dt>
416<dd>return any errors or warnings in this structure. </dd>
417
418<dd>  </dd>
419</dl>
420<h2><a href="../../api/MagickCore/statistic_8c.html" id="PolynomialImage">PolynomialImage</a></h2>
421
422<p>PolynomialImage() returns a new image where each pixel is the sum of the pixels in the image sequence after applying its corresponding terms (coefficient and degree pairs).</p>
423
424<p>The format of the PolynomialImage method is:</p>
425
426<pre class="text">
427Image *PolynomialImage(const Image *images,const size_t number_terms,
428  const double *terms,ExceptionInfo *exception)
429</pre>
430
431<p>A description of each parameter follows:</p>
432
433<dd>
434</dd>
435
436<dd> </dd>
437<dl class="dl-horizontal">
438<dt>images</dt>
439<dd>the image sequence. </dd>
440
441<dd> </dd>
442<dt>number_terms</dt>
443<dd>the number of terms in the list.  The actual list length is 2 x number_terms + 1 (the constant). </dd>
444
445<dd> </dd>
446<dt>terms</dt>
447<dd>the list of polynomial coefficients and degree pairs and a constant. </dd>
448
449<dd> </dd>
450<dt>exception</dt>
451<dd>return any errors or warnings in this structure. </dd>
452
453<dd>  </dd>
454</dl>
455<h2><a href="../../api/MagickCore/statistic_8c.html" id="StatisticImage">StatisticImage</a></h2>
456
457<p>StatisticImage() makes each pixel the min / max / median / mode / etc. of the neighborhood of the specified width and height.</p>
458
459<p>The format of the StatisticImage method is:</p>
460
461<pre class="text">
462Image *StatisticImage(const Image *image,const StatisticType type,
463  const size_t width,const size_t height,ExceptionInfo *exception)
464</pre>
465
466<p>A description of each parameter follows:</p>
467
468<dd>
469</dd>
470
471<dd> </dd>
472<dl class="dl-horizontal">
473<dt>image</dt>
474<dd>the image. </dd>
475
476<dd> </dd>
477<dt>type</dt>
478<dd>the statistic type (median, mode, etc.). </dd>
479
480<dd> </dd>
481<dt>width</dt>
482<dd>the width of the pixel neighborhood. </dd>
483
484<dd> </dd>
485<dt>height</dt>
486<dd>the height of the pixel neighborhood. </dd>
487
488<dd> </dd>
489<dt>exception</dt>
490<dd>return any errors or warnings in this structure. </dd>
491
492<dd>  </dd>
493</dl>
494</div>
495    </div>
496  </main><!-- /.container -->
497  <footer class="magick-footer">
498    <p><a href="../../www/security-policy.html">Security</a> •
499    <a href="../../www/architecture.html">Architecture</a> •
500    <a href="../../www/links.html">Related</a> •
501     <a href="../../www/sitemap.html">Sitemap</a>
502
503    <a href="statistic.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../../images/wand.ico"/></a>
504
505    <a href="http://pgp.mit.edu/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
506    <a href="../../www/support.html">Donate</a> •
507    <a href="../../www/contact.html">Contact Us</a>
508    <br/>
509    <small>© 1999-2019 ImageMagick Studio LLC</small></p>
510  </footer>
511
512  <!-- Javascript assets -->
513  <script src="../assets/magick.js" crossorigin="anonymous"></script>
514  <script>window.jQuery || document.write('<script src="https://localhost/ajax/libs/jquery/3.3.1/jquery.min.js"><\/script>')</script>
515</body>
516</html>
517<!-- Magick Cache 30th December 2018 10:19 -->