8 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
9 <title>ImageMagick: MagickCore, C API for ImageMagick: Image Statistics</title>
10 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
11 <meta name="application-name" content="ImageMagick"/>
12 <meta name="description" content="ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves."/>
13 <meta name="application-url" content="http://www.imagemagick.org"/>
14 <meta name="generator" content="PHP"/>
15 <meta name="keywords" content="magickcore, c, api, for, imagemagick:, 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-2015 ImageMagick Studio LLC"/>
23 <meta name="distribution" content="Global"/>
24 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/>
25 <link rel="icon" href="../image/wand.png">
26 <link rel="shortcut icon" href="../image/wand.ico">
27 <link rel="stylesheet" href="../css/magick.php">
31 <div class="magick-masthead">
32 <div class="container">
33 <script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
35 data-ad-client="ca-pub-3129977114552745"
36 data-ad-slot="6345125851"
37 data-ad-format="auto"></ins>
39 (adsbygoogle = window.adsbygoogle || []).push({});
41 <nav class="magick-nav">
42 <a class="magick-nav-item " href="../index.php">Home</a>
43 <a class="magick-nav-item " href="../script/binary-releases.php">Download</a>
44 <a class="magick-nav-item " href="../script/command-line-tools.php">Tools</a>
45 <a class="magick-nav-item " href="../script/command-line-options.php">Options</a>
46 <a class="magick-nav-item " href="../script/resources.php">Resources</a>
47 <a class="magick-nav-item " href="../script/api.php">Develop</a>
48 <a class="magick-nav-item " href="../script/search.php">Search</a>
49 <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a>
53 <div class="container">
54 <div class="magick-header">
55 <p class="text-center"><a href="statistic.php#EvaluateImage">EvaluateImage</a> • <a href="statistic.php#FunctionImage">FunctionImage</a> • <a href="statistic.php#GetImageEntropy">GetImageEntropy</a> • <a href="statistic.php#GetImageExtrema">GetImageExtrema</a> • <a href="statistic.php#GetImageKurtosis">GetImageKurtosis</a> • <a href="statistic.php#GetImageMean">GetImageMean</a> • <a href="statistic.php#GetImageMoments">GetImageMoments</a> • <a href="statistic.php#GetImagePerceptualHash">GetImagePerceptualHash</a> • <a href="statistic.php#GetImageRange">GetImageRange</a> • <a href="statistic.php#GetImageStatistics">GetImageStatistics</a> • <a href="statistic.php#PolynomialImage">PolynomialImage</a> • <a href="statistic.php#StatisticImage">StatisticImage</a></p>
57 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/statistic_8c.html" id="EvaluateImage">EvaluateImage</a></h2>
59 <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>
61 <p>The format of the EvaluateImage method is:</p>
64 MagickBooleanType EvaluateImage(Image *image,
65 const MagickEvaluateOperator op,const double value,
66 ExceptionInfo *exception)
67 MagickBooleanType EvaluateImages(Image *images,
68 const MagickEvaluateOperator op,const double value,
69 ExceptionInfo *exception)
72 <p>A description of each parameter follows:</p>
78 <dl class="dl-horizontal">
84 <dd>A channel op. </dd>
88 <dd>A value value. </dd>
92 <dd>return any errors or warnings in this structure. </dd>
96 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/statistic_8c.html" id="FunctionImage">FunctionImage</a></h2>
98 <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>
100 <p>The format of the FunctionImage method is:</p>
103 MagickBooleanType FunctionImage(Image *image,
104 const MagickFunction function,const ssize_t number_parameters,
105 const double *parameters,ExceptionInfo *exception)
108 <p>A description of each parameter follows:</p>
114 <dl class="dl-horizontal">
120 <dd>A channel function. </dd>
124 <dd>one or more parameters. </dd>
128 <dd>return any errors or warnings in this structure. </dd>
132 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/statistic_8c.html" id="GetImageEntropy">GetImageEntropy</a></h2>
134 <p>GetImageEntropy() returns the entropy of one or more image channels.</p>
136 <p>The format of the GetImageEntropy method is:</p>
139 MagickBooleanType GetImageEntropy(const Image *image,double *entropy,
140 ExceptionInfo *exception)
143 <p>A description of each parameter follows:</p>
149 <dl class="dl-horizontal">
155 <dd>the average entropy of the selected channels. </dd>
159 <dd>return any errors or warnings in this structure. </dd>
163 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/statistic_8c.html" id="GetImageExtrema">GetImageExtrema</a></h2>
165 <p>GetImageExtrema() returns the extrema of one or more image channels.</p>
167 <p>The format of the GetImageExtrema method is:</p>
170 MagickBooleanType GetImageExtrema(const Image *image,size_t *minima,
171 size_t *maxima,ExceptionInfo *exception)
174 <p>A description of each parameter follows:</p>
180 <dl class="dl-horizontal">
186 <dd>the minimum value in the channel. </dd>
190 <dd>the maximum value in the channel. </dd>
194 <dd>return any errors or warnings in this structure. </dd>
198 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/statistic_8c.html" id="GetImageKurtosis">GetImageKurtosis</a></h2>
200 <p>GetImageKurtosis() returns the kurtosis and skewness of one or more image channels.</p>
202 <p>The format of the GetImageKurtosis method is:</p>
205 MagickBooleanType GetImageKurtosis(const Image *image,double *kurtosis,
206 double *skewness,ExceptionInfo *exception)
209 <p>A description of each parameter follows:</p>
215 <dl class="dl-horizontal">
221 <dd>the kurtosis of the channel. </dd>
225 <dd>the skewness of the channel. </dd>
229 <dd>return any errors or warnings in this structure. </dd>
233 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/statistic_8c.html" id="GetImageMean">GetImageMean</a></h2>
235 <p>GetImageMean() returns the mean and standard deviation of one or more image channels.</p>
237 <p>The format of the GetImageMean method is:</p>
240 MagickBooleanType GetImageMean(const Image *image,double *mean,
241 double *standard_deviation,ExceptionInfo *exception)
244 <p>A description of each parameter follows:</p>
250 <dl class="dl-horizontal">
256 <dd>the average value in the channel. </dd>
259 <dt>standard_deviation</dt>
260 <dd>the standard deviation of the channel. </dd>
264 <dd>return any errors or warnings in this structure. </dd>
268 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/statistic_8c.html" id="GetImageMoments">GetImageMoments</a></h2>
270 <p>GetImageMoments() returns the normalized moments of one or more image channels.</p>
272 <p>The format of the GetImageMoments method is:</p>
275 ChannelMoments *GetImageMoments(const Image *image,
276 ExceptionInfo *exception)
279 <p>A description of each parameter follows:</p>
285 <dl class="dl-horizontal">
291 <dd>return any errors or warnings in this structure. </dd>
295 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/statistic_8c.html" id="GetImagePerceptualHash">GetImagePerceptualHash</a></h2>
297 <p>GetImagePerceptualHash() returns the perceptual hash of one or more image channels.</p>
299 <p>The format of the GetImagePerceptualHash method is:</p>
302 ChannelPerceptualHash *GetImagePerceptualHash(const Image *image,
303 ExceptionInfo *exception)
306 <p>A description of each parameter follows:</p>
312 <dl class="dl-horizontal">
318 <dd>return any errors or warnings in this structure. </dd>
322 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/statistic_8c.html" id="GetImageRange">GetImageRange</a></h2>
324 <p>GetImageRange() returns the range of one or more image channels.</p>
326 <p>The format of the GetImageRange method is:</p>
329 MagickBooleanType GetImageRange(const Image *image,double *minima,
330 double *maxima,ExceptionInfo *exception)
333 <p>A description of each parameter follows:</p>
339 <dl class="dl-horizontal">
345 <dd>the minimum value in the channel. </dd>
349 <dd>the maximum value in the channel. </dd>
353 <dd>return any errors or warnings in this structure. </dd>
357 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/statistic_8c.html" id="GetImageStatistics">GetImageStatistics</a></h2>
359 <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>
362 channel_statistics=GetImageStatistics(image,exception);
363 red_mean=channel_statistics[RedPixelChannel].mean;
366 <p>Use MagickRelinquishMemory() to free the statistics buffer.</p>
368 <p>The format of the GetImageStatistics method is:</p>
371 ChannelStatistics *GetImageStatistics(const Image *image,
372 ExceptionInfo *exception)
375 <p>A description of each parameter follows:</p>
381 <dl class="dl-horizontal">
387 <dd>return any errors or warnings in this structure. </dd>
391 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/statistic_8c.html" id="PolynomialImage">PolynomialImage</a></h2>
393 <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>
395 <p>The format of the PolynomialImage method is:</p>
398 Image *PolynomialImage(const Image *images,const size_t number_terms,
399 const double *terms,ExceptionInfo *exception)
402 <p>A description of each parameter follows:</p>
408 <dl class="dl-horizontal">
410 <dd>the image sequence. </dd>
413 <dt>number_terms</dt>
414 <dd>the number of terms in the list. The actual list length is 2 x number_terms + 1 (the constant). </dd>
418 <dd>the list of polynomial coefficients and degree pairs and a constant. </dd>
422 <dd>return any errors or warnings in this structure. </dd>
426 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/statistic_8c.html" id="StatisticImage">StatisticImage</a></h2>
428 <p>StatisticImage() makes each pixel the min / max / median / mode / etc. of the neighborhood of the specified width and height.</p>
430 <p>The format of the StatisticImage method is:</p>
433 Image *StatisticImage(const Image *image,const StatisticType type,
434 const size_t width,const size_t height,ExceptionInfo *exception)
437 <p>A description of each parameter follows:</p>
443 <dl class="dl-horizontal">
449 <dd>the statistic type (median, mode, etc.). </dd>
453 <dd>the width of the pixel neighborhood. </dd>
457 <dd>the height of the pixel neighborhood. </dd>
461 <dd>return any errors or warnings in this structure. </dd>
466 <footer class="magick-footer">
467 <p><a href="../script/support.php">Donate</a> •
468 <a href="../script/sitemap.php">Sitemap</a> •
469 <a href="../script/links.php">Related</a> •
470 <a href="../script/architecture.php">Architecture</a>
472 <p><a href="statistic.php#">Back to top</a> •
473 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> •
474 <a href="../script/contact.php">Contact Us</a></p>
475 <p><small>© 1999-2015 ImageMagick Studio LLC</small></p>
477 </div><!-- /.container -->
479 <script src="http://nextgen.imagemagick.org/js/magick.php"></script>