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="ImageMagick® creates, edits, composes, and converts bitmap images. Resize an image, crop it, change its shades and colors, add captions, and more." />
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-2019 ImageMagick Studio LLC" />
23 <meta name="distribution" content="Global" />
24 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" />
25 <meta property='og:url' content='../../' />
26 <meta property='og:title' content='ImageMagick' />
27 <meta property='og:image' content='../../images/logo.png' />
28 <meta property='og:type' content='website' />
29 <meta property='og:site_name' content='ImageMagick' />
30 <meta property='og:description' content="Convert, Edit, or Compose Bitmap Images" />
31 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
32 <link href="statistic.html" rel="canonical" />
33 <link href="../images/wand.png" rel="icon" />
34 <link href="../images/wand.ico" rel="shortcut icon" />
35 <link href="assets/magick.css" rel="stylesheet" />
39 <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
40 <a class="navbar-brand" href="../index.html"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../images/wand.ico"/></a>
41 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsMagick" aria-controls="navbarsMagick" aria-expanded="false" aria-label="Toggle navigation">
42 <span class="navbar-toggler-icon"></span>
45 <div class="navbar-collapse collapse" id="navbarsMagick" style="">
46 <ul class="navbar-nav mr-auto">
47 <li class="nav-item ">
48 <a class="nav-link" href="montage.html">Home <span class="sr-only">(current)</span></a>
50 <li class="nav-item ">
51 <a class="nav-link" href="../www/download.html">Download</a>
53 <li class="nav-item ">
54 <a class="nav-link" href="../www/command-line-tools.html">Tools</a>
56 <li class="nav-item ">
57 <a class="nav-link" href="../www/command-line-processing.html">Command-line</a>
59 <li class="nav-item ">
60 <a class="nav-link" href="../www/resources.html">Resources</a>
62 <li class="nav-item ">
63 <a class="nav-link" href="../www/develop.html">Develop</a>
66 <a class="nav-link" target="_blank" href="../https://imagemagick.org/discourse-server//">Community</a>
69 <form class="form-inline my-2 my-lg-0" action="../https://imagemagick.org/script/search.php">
70 <input class="form-control mr-sm-2" type="text" name="q" placeholder="Search" aria-label="Search">
71 <button class="btn btn-outline-success my-2 my-sm-0" type="submit" name="sa">Search</button>
75 <div class="container">
76 <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
78 data-ad-client="ca-pub-3129977114552745"
79 data-ad-slot="6345125851"
80 data-ad-format="auto"></ins>
82 (adsbygoogle = window.adsbygoogle || []).push({});
87 <main class="container">
88 <div class="magick-template">
89 <div class="magick-header">
90 <p class="text-center"><a href="statistic.html#EvaluateImage">EvaluateImage</a> • <a href="statistic.html#FunctionImage">FunctionImage</a> • <a href="statistic.html#GetImageEntropy">GetImageEntropy</a> • <a href="statistic.html#GetImageExtrema">GetImageExtrema</a> • <a href="statistic.html#GetImageKurtosis">GetImageKurtosis</a> • <a href="statistic.html#GetImageMean">GetImageMean</a> • <a href="statistic.html#GetImageMoments">GetImageMoments</a> • <a href="statistic.html#GetImagePerceptualHash">GetImagePerceptualHash</a> • <a href="statistic.html#GetImageRange">GetImageRange</a> • <a href="statistic.html#GetImageStatistics">GetImageStatistics</a> • <a href="statistic.html#PolynomialImage">PolynomialImage</a> • <a href="statistic.html#StatisticImage">StatisticImage</a></p>
92 <h2><a href="../../api/MagickCore/statistic_8c.html" id="EvaluateImage">EvaluateImage</a></h2>
94 <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>
96 <p>The format of the EvaluateImage method is:</p>
99 MagickBooleanType EvaluateImage(Image *image,
100 const MagickEvaluateOperator op,const double value,
101 ExceptionInfo *exception)
102 MagickBooleanType EvaluateImages(Image *images,
103 const MagickEvaluateOperator op,const double value,
104 ExceptionInfo *exception)
107 <p>A description of each parameter follows:</p>
113 <dl class="dl-horizontal">
119 <dd>A channel op. </dd>
123 <dd>A value value. </dd>
127 <dd>return any errors or warnings in this structure. </dd>
131 <h2><a href="../../api/MagickCore/statistic_8c.html" id="FunctionImage">FunctionImage</a></h2>
133 <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>
135 <p>The format of the FunctionImage method is:</p>
138 MagickBooleanType FunctionImage(Image *image,
139 const MagickFunction function,const ssize_t number_parameters,
140 const double *parameters,ExceptionInfo *exception)
143 <p>A description of each parameter follows:</p>
149 <dl class="dl-horizontal">
155 <dd>A channel function. </dd>
159 <dd>one or more parameters. </dd>
163 <dd>return any errors or warnings in this structure. </dd>
167 <h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageEntropy">GetImageEntropy</a></h2>
169 <p>GetImageEntropy() returns the entropy of one or more image channels.</p>
171 <p>The format of the GetImageEntropy method is:</p>
174 MagickBooleanType GetImageEntropy(const Image *image,double *entropy,
175 ExceptionInfo *exception)
178 <p>A description of each parameter follows:</p>
184 <dl class="dl-horizontal">
190 <dd>the average entropy of the selected channels. </dd>
194 <dd>return any errors or warnings in this structure. </dd>
198 <h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageExtrema">GetImageExtrema</a></h2>
200 <p>GetImageExtrema() returns the extrema of one or more image channels.</p>
202 <p>The format of the GetImageExtrema method is:</p>
205 MagickBooleanType GetImageExtrema(const Image *image,size_t *minima,
206 size_t *maxima,ExceptionInfo *exception)
209 <p>A description of each parameter follows:</p>
215 <dl class="dl-horizontal">
221 <dd>the minimum value in the channel. </dd>
225 <dd>the maximum value in the channel. </dd>
229 <dd>return any errors or warnings in this structure. </dd>
233 <h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageKurtosis">GetImageKurtosis</a></h2>
235 <p>GetImageKurtosis() returns the kurtosis and skewness of one or more image channels.</p>
237 <p>The format of the GetImageKurtosis method is:</p>
240 MagickBooleanType GetImageKurtosis(const Image *image,double *kurtosis,
241 double *skewness,ExceptionInfo *exception)
244 <p>A description of each parameter follows:</p>
250 <dl class="dl-horizontal">
256 <dd>the kurtosis of the channel. </dd>
260 <dd>the skewness of the channel. </dd>
264 <dd>return any errors or warnings in this structure. </dd>
268 <h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageMean">GetImageMean</a></h2>
270 <p>GetImageMean() returns the mean and standard deviation of one or more image channels.</p>
272 <p>The format of the GetImageMean method is:</p>
275 MagickBooleanType GetImageMean(const Image *image,double *mean,
276 double *standard_deviation,ExceptionInfo *exception)
279 <p>A description of each parameter follows:</p>
285 <dl class="dl-horizontal">
291 <dd>the average value in the channel. </dd>
294 <dt>standard_deviation</dt>
295 <dd>the standard deviation of the channel. </dd>
299 <dd>return any errors or warnings in this structure. </dd>
303 <h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageMoments">GetImageMoments</a></h2>
305 <p>GetImageMoments() returns the normalized moments of one or more image channels.</p>
307 <p>The format of the GetImageMoments method is:</p>
310 ChannelMoments *GetImageMoments(const Image *image,
311 ExceptionInfo *exception)
314 <p>A description of each parameter follows:</p>
320 <dl class="dl-horizontal">
326 <dd>return any errors or warnings in this structure. </dd>
330 <h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImagePerceptualHash">GetImagePerceptualHash</a></h2>
332 <p>GetImagePerceptualHash() returns the perceptual hash of one or more image channels.</p>
334 <p>The format of the GetImagePerceptualHash method is:</p>
337 ChannelPerceptualHash *GetImagePerceptualHash(const Image *image,
338 ExceptionInfo *exception)
341 <p>A description of each parameter follows:</p>
347 <dl class="dl-horizontal">
353 <dd>return any errors or warnings in this structure. </dd>
357 <h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageRange">GetImageRange</a></h2>
359 <p>GetImageRange() returns the range of one or more image channels.</p>
361 <p>The format of the GetImageRange method is:</p>
364 MagickBooleanType GetImageRange(const Image *image,double *minima,
365 double *maxima,ExceptionInfo *exception)
368 <p>A description of each parameter follows:</p>
374 <dl class="dl-horizontal">
380 <dd>the minimum value in the channel. </dd>
384 <dd>the maximum value in the channel. </dd>
388 <dd>return any errors or warnings in this structure. </dd>
392 <h2><a href="../../api/MagickCore/statistic_8c.html" id="GetImageStatistics">GetImageStatistics</a></h2>
394 <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>
397 channel_statistics=GetImageStatistics(image,exception);
398 red_mean=channel_statistics[RedPixelChannel].mean;
401 <p>Use MagickRelinquishMemory() to free the statistics buffer.</p>
403 <p>The format of the GetImageStatistics method is:</p>
406 ChannelStatistics *GetImageStatistics(const Image *image,
407 ExceptionInfo *exception)
410 <p>A description of each parameter follows:</p>
416 <dl class="dl-horizontal">
422 <dd>return any errors or warnings in this structure. </dd>
426 <h2><a href="../../api/MagickCore/statistic_8c.html" id="PolynomialImage">PolynomialImage</a></h2>
428 <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>
430 <p>The format of the PolynomialImage method is:</p>
433 Image *PolynomialImage(const Image *images,const size_t number_terms,
434 const double *terms,ExceptionInfo *exception)
437 <p>A description of each parameter follows:</p>
443 <dl class="dl-horizontal">
445 <dd>the image sequence. </dd>
448 <dt>number_terms</dt>
449 <dd>the number of terms in the list. The actual list length is 2 x number_terms + 1 (the constant). </dd>
453 <dd>the list of polynomial coefficients and degree pairs and a constant. </dd>
457 <dd>return any errors or warnings in this structure. </dd>
461 <h2><a href="../../api/MagickCore/statistic_8c.html" id="StatisticImage">StatisticImage</a></h2>
463 <p>StatisticImage() makes each pixel the min / max / median / mode / etc. of the neighborhood of the specified width and height.</p>
465 <p>The format of the StatisticImage method is:</p>
468 Image *StatisticImage(const Image *image,const StatisticType type,
469 const size_t width,const size_t height,ExceptionInfo *exception)
472 <p>A description of each parameter follows:</p>
478 <dl class="dl-horizontal">
484 <dd>the statistic type (median, mode, etc.). </dd>
488 <dd>the width of the pixel neighborhood. </dd>
492 <dd>the height of the pixel neighborhood. </dd>
496 <dd>return any errors or warnings in this structure. </dd>
502 </main><!-- /.container -->
503 <footer class="magick-footer">
504 <p><a href="../www/security-policy.html">Security</a> •
505 <a href="../www/architecture.html">Architecture</a>
507 <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>
509 <a href="../www/links.html">Related</a> •
510 <a href="../www/sitemap.html">Sitemap</a>
512 <a href="../www/support.html">Donate</a> •
513 <a href="http://pgp.mit.edu/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> •
514 <a href="../www/contact.html">Contact Us</a>
516 <small>© 1999-2019 ImageMagick Studio LLC</small></p>
519 <!-- Javascript assets -->
520 <script src="assets/magick.js" crossorigin="anonymous"></script>
521 <script>window.jQuery || document.write('<script src="https://localhost/ajax/libs/jquery/3.3.1/jquery.min.js"><\/script>')</script>
524 <!-- Magick Cache 24th April 2019 19:56 -->