1
2
3
4
5<!DOCTYPE html>
6<html lang="en">
7<head>
8    <title>ImageMagick: MagickCore, C API for ImageMagick: Image Histograms</title>
9  <meta charset="utf-8" />
10  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
11  <meta name="viewport" content="width=device-width, initial-scale=1" />
12  <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
13  <meta name="application-name" content="ImageMagick"/>
14  <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."/>
15  <meta name="application-url" content="http://www.imagemagick.org"/>
16  <meta name="generator" content="PHP"/>
17  <meta name="keywords" content="magickcore, c, api, for, imagemagick:, image, histograms, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert"/>
18  <meta name="rating" content="GENERAL"/>
19  <meta name="robots" content="INDEX, FOLLOW"/>
20  <meta name="generator" content="ImageMagick Studio LLC"/>
21  <meta name="author" content="ImageMagick Studio LLC"/>
22  <meta name="revisit-after" content="2 DAYS"/>
23  <meta name="resource-type" content="document"/>
24  <meta name="copyright" content="Copyright (c) 1999-2016 ImageMagick Studio LLC"/>
25  <meta name="distribution" content="Global"/>
26  <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/>
27  <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
28  <link rel="icon" href="../images/wand.png"/>
29  <link rel="shortcut icon" href="../images/wand.ico"/>
30  <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto:900,400,400italic,700,700italic,300,300italic|Open+Sans:300italic,400italic,700italic,300,400,600,700">
31  <link rel="stylesheet" href="../css/magick.html"/>
32</head>
33<body>
34<div class="main">
35<div class="magick-masthead">
36  <div class="container">
37    <script async="async" src="http://localhost/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
38         style="display:block"
39         data-ad-client="ca-pub-3129977114552745"
40         data-ad-slot="6345125851"
41         data-ad-format="auto"></ins>
42    <script>
43      (adsbygoogle = window.adsbygoogle || []).push({});
44    </script>
45    <nav class="magick-nav">
46      <a class="magick-nav-item " href="../index.html">Home</a>
47      <a class="magick-nav-item " href="../binary-releases.html">Download</a>
48      <a class="magick-nav-item " href="../command-line-tools.html">Tools</a>
49      <a class="magick-nav-item " href="../command-line-processing.html">Command-line</a>
50      <a class="magick-nav-item " href="../resources.html">Resources</a>
51      <a class="magick-nav-item " href="api.html">Develop</a>
52      <a class="magick-nav-item " href="http://www.imagemagick.org/script/search.php">Search</a>
53      <a class="magick-nav-item pull-right" href="https://www.imagemagick.org/discourse-server/">Community</a>
54    </nav>
55  </div>
56</div>
57<div class="container">
58<div class="magick-header">
59<p class="text-center"><a href="histogram.html#GetImageHistogram">GetImageHistogram</a> &#8226; <a href="histogram.html#IdentifyPaletteImage">IdentifyPaletteImage</a> &#8226; <a href="histogram.html#IsHistogramImage">IsHistogramImage</a> &#8226; <a href="histogram.html#IsPaletteImage">IsPaletteImage</a> &#8226; <a href="histogram.html#MinMaxStretchImage">MinMaxStretchImage</a> &#8226; <a href="histogram.html#GetNumberColors">GetNumberColors</a> &#8226; <a href="histogram.html#UniqueImageColors">UniqueImageColors</a></p>
60
61<h2><a href="http://www.imagemagick.org/api/MagickCore/histogram_8c.html" id="GetImageHistogram">GetImageHistogram</a></h2>
62
63<p>GetImageHistogram() returns the unique colors in an image.</p>
64
65<p>The format of the GetImageHistogram method is:</p>
66
67<pre class="text">
68size_t GetImageHistogram(const Image *image,
69  size_t *number_colors,ExceptionInfo *exception)
70</pre>
71
72<p>A description of each parameter follows.</p>
73
74<dt>image</dt>
75<p>the image.</p>
76
77<dt>file</dt>
78<p>Write a histogram of the color distribution to this file handle.</p>
79
80<dt>exception</dt>
81<p>return any errors or warnings in this structure.</p>
82
83<h2><a href="http://www.imagemagick.org/api/MagickCore/histogram_8c.html" id="IdentifyPaletteImage">IdentifyPaletteImage</a></h2>
84
85<p>IdentifyPaletteImage() returns MagickTrue if the image has 256 unique colors or less.</p>
86
87<p>The format of the IdentifyPaletteImage method is:</p>
88
89<pre class="text">
90MagickBooleanType IdentifyPaletteImage(const Image *image,
91  ExceptionInfo *exception)
92</pre>
93
94<p>A description of each parameter follows.</p>
95
96<dt>image</dt>
97<p>the image.</p>
98
99<dt>exception</dt>
100<p>return any errors or warnings in this structure.</p>
101
102<h2><a href="http://www.imagemagick.org/api/MagickCore/histogram_8c.html" id="IsHistogramImage">IsHistogramImage</a></h2>
103
104<p>IsHistogramImage() returns MagickTrue if the image has 1024 unique colors or less.</p>
105
106<p>The format of the IsHistogramImage method is:</p>
107
108<pre class="text">
109MagickBooleanType IsHistogramImage(const Image *image,
110  ExceptionInfo *exception)
111</pre>
112
113<p>A description of each parameter follows.</p>
114
115<dt>image</dt>
116<p>the image.</p>
117
118<dt>exception</dt>
119<p>return any errors or warnings in this structure.</p>
120
121<h2><a href="http://www.imagemagick.org/api/MagickCore/histogram_8c.html" id="IsPaletteImage">IsPaletteImage</a></h2>
122
123<p>IsPaletteImage() returns MagickTrue if the image is PseudoClass and has 256 unique colors or less.</p>
124
125<p>The format of the IsPaletteImage method is:</p>
126
127<pre class="text">
128MagickBooleanType IsPaletteImage(const Image *image)
129</pre>
130
131<p>A description of each parameter follows.</p>
132
133<dt>image</dt>
134<p>the image.</p>
135
136<h2><a href="http://www.imagemagick.org/api/MagickCore/histogram_8c.html" id="MinMaxStretchImage">MinMaxStretchImage</a></h2>
137
138<p>MinMaxStretchImage() uses the exact minimum and maximum values found in each of the channels given, as the BlackPoint and WhitePoint to linearly stretch the colors (and histogram) of the image.  The stretch points are also moved further inward by the adjustment values given.</p>
139
140<p>If the adjustment values are both zero this function is equivalent to a perfect normalization (or autolevel) of the image.</p>
141
142<p>Each channel is stretched independantally of each other (producing color distortion) unless the special 'SyncChannels' flag is also provided in the channels setting. If this flag is present the minimum and maximum point will be extracted from all the given channels, and those channels will be stretched by exactly the same amount (preventing color distortion).</p>
143
144<p>In the special case that only ONE value is found in a channel of the image that value is not stretched, that value is left as is.</p>
145
146<p>The 'SyncChannels' is turned on in the 'DefaultChannels' setting by default.</p>
147
148<p>The format of the MinMaxStretchImage method is:</p>
149
150<pre class="text">
151MagickBooleanType MinMaxStretchImage(Image *image,const double black,
152  const double white,const double gamma,ExceptionInfo *exception)
153</pre>
154
155<p>A description of each parameter follows:</p>
156
157<dd>
158</dd>
159
160<dd> </dd>
161<dl class="dl-horizontal">
162<dt>image</dt>
163<dd>The image to auto-level </dd>
164
165<dd> </dd>
166<dt>black, white</dt>
167<dd> move the black / white point inward from the minimum and maximum points by this color value. </dd>
168
169<dd> </dd>
170<dt>gamma</dt>
171<dd>the gamma. </dd>
172
173<dd> </dd>
174<dt>exception</dt>
175<dd>return any errors or warnings in this structure. </dd>
176
177<dd>  </dd>
178</dl>
179<h2><a href="http://www.imagemagick.org/api/MagickCore/histogram_8c.html" id="GetNumberColors">GetNumberColors</a></h2>
180
181<p>GetNumberColors() returns the number of unique colors in an image.</p>
182
183<p>The format of the GetNumberColors method is:</p>
184
185<pre class="text">
186size_t GetNumberColors(const Image *image,FILE *file,
187  ExceptionInfo *exception)
188</pre>
189
190<p>A description of each parameter follows.</p>
191
192<dt>image</dt>
193<p>the image.</p>
194
195<dt>file</dt>
196<p>Write a histogram of the color distribution to this file handle.</p>
197
198<dt>exception</dt>
199<p>return any errors or warnings in this structure.</p>
200
201<h2><a href="http://www.imagemagick.org/api/MagickCore/histogram_8c.html" id="UniqueImageColors">UniqueImageColors</a></h2>
202
203<p>UniqueImageColors() returns the unique colors of an image.</p>
204
205<p>The format of the UniqueImageColors method is:</p>
206
207<pre class="text">
208Image *UniqueImageColors(const Image *image,ExceptionInfo *exception)
209</pre>
210
211<p>A description of each parameter follows.</p>
212
213<dt>image</dt>
214<p>the image.</p>
215
216<dt>exception</dt>
217<p>return any errors or warnings in this structure.</p>
218
219</div>
220  <footer class="magick-footer">
221    <p><a href="../support.html">Donate</a> •
222     <a href="../sitemap.html">Sitemap</a> •
223    <a href="../links.html">Related</a> •
224    <a href="../architecture.html">Architecture</a>
225</p>
226    <p><a href="histogram.html#">Back to top</a> •
227    <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
228    <a href="http://www.imagemagick.org/script/contact.php">Contact Us</a></p>
229        <p><small>©  1999-2016 ImageMagick Studio LLC</small></p>
230  </footer>
231</div><!-- /.container -->
232
233  <script src="https://localhost/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
234  <script src="../js/magick.html"></script>
235</div>
236</body>
237</html>
238