• 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 Histograms @ 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, histograms, 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="histogram.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="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>
85
86<h2><a href="../../api/MagickCore/histogram_8c.html" id="GetImageHistogram">GetImageHistogram</a></h2>
87
88<p>GetImageHistogram() returns the unique colors in an image.</p>
89
90<p>The format of the GetImageHistogram method is:</p>
91
92<pre class="text">
93size_t GetImageHistogram(const Image *image,
94  size_t *number_colors,ExceptionInfo *exception)
95</pre>
96
97<p>A description of each parameter follows.</p>
98
99<dt>image</dt>
100<p>the image.</p>
101
102<dt>file</dt>
103<p>Write a histogram of the color distribution to this file handle.</p>
104
105<dt>exception</dt>
106<p>return any errors or warnings in this structure.</p>
107
108<h2><a href="../../api/MagickCore/histogram_8c.html" id="IdentifyPaletteImage">IdentifyPaletteImage</a></h2>
109
110<p>IdentifyPaletteImage() returns MagickTrue if the image has 256 unique colors or less.</p>
111
112<p>The format of the IdentifyPaletteImage method is:</p>
113
114<pre class="text">
115MagickBooleanType IdentifyPaletteImage(const Image *image,
116  ExceptionInfo *exception)
117</pre>
118
119<p>A description of each parameter follows.</p>
120
121<dt>image</dt>
122<p>the image.</p>
123
124<dt>exception</dt>
125<p>return any errors or warnings in this structure.</p>
126
127<h2><a href="../../api/MagickCore/histogram_8c.html" id="IsHistogramImage">IsHistogramImage</a></h2>
128
129<p>IsHistogramImage() returns MagickTrue if the image has 1024 unique colors or less.</p>
130
131<p>The format of the IsHistogramImage method is:</p>
132
133<pre class="text">
134MagickBooleanType IsHistogramImage(const Image *image,
135  ExceptionInfo *exception)
136</pre>
137
138<p>A description of each parameter follows.</p>
139
140<dt>image</dt>
141<p>the image.</p>
142
143<dt>exception</dt>
144<p>return any errors or warnings in this structure.</p>
145
146<h2><a href="../../api/MagickCore/histogram_8c.html" id="IsPaletteImage">IsPaletteImage</a></h2>
147
148<p>IsPaletteImage() returns MagickTrue if the image is PseudoClass and has 256 unique colors or less.</p>
149
150<p>The format of the IsPaletteImage method is:</p>
151
152<pre class="text">
153MagickBooleanType IsPaletteImage(const Image *image)
154</pre>
155
156<p>A description of each parameter follows.</p>
157
158<dt>image</dt>
159<p>the image.</p>
160
161<h2><a href="../../api/MagickCore/histogram_8c.html" id="MinMaxStretchImage">MinMaxStretchImage</a></h2>
162
163<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>
164
165<p>If the adjustment values are both zero this function is equivalent to a perfect normalization (or autolevel) of the image.</p>
166
167<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>
168
169<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>
170
171<p>The 'SyncChannels' is turned on in the 'DefaultChannels' setting by default.</p>
172
173<p>The format of the MinMaxStretchImage method is:</p>
174
175<pre class="text">
176MagickBooleanType MinMaxStretchImage(Image *image,const double black,
177  const double white,const double gamma,ExceptionInfo *exception)
178</pre>
179
180<p>A description of each parameter follows:</p>
181
182<dd>
183</dd>
184
185<dd> </dd>
186<dl class="dl-horizontal">
187<dt>image</dt>
188<dd>The image to auto-level </dd>
189
190<dd> </dd>
191<dt>black, white</dt>
192<dd> move the black / white point inward from the minimum and maximum points by this color value. </dd>
193
194<dd> </dd>
195<dt>gamma</dt>
196<dd>the gamma. </dd>
197
198<dd> </dd>
199<dt>exception</dt>
200<dd>return any errors or warnings in this structure. </dd>
201
202<dd>  </dd>
203</dl>
204<h2><a href="../../api/MagickCore/histogram_8c.html" id="GetNumberColors">GetNumberColors</a></h2>
205
206<p>GetNumberColors() returns the number of unique colors in an image.</p>
207
208<p>The format of the GetNumberColors method is:</p>
209
210<pre class="text">
211size_t GetNumberColors(const Image *image,FILE *file,
212  ExceptionInfo *exception)
213</pre>
214
215<p>A description of each parameter follows.</p>
216
217<dt>image</dt>
218<p>the image.</p>
219
220<dt>file</dt>
221<p>Write a histogram of the color distribution to this file handle.</p>
222
223<dt>exception</dt>
224<p>return any errors or warnings in this structure.</p>
225
226<h2><a href="../../api/MagickCore/histogram_8c.html" id="UniqueImageColors">UniqueImageColors</a></h2>
227
228<p>UniqueImageColors() returns the unique colors of an image.</p>
229
230<p>The format of the UniqueImageColors method is:</p>
231
232<pre class="text">
233Image *UniqueImageColors(const Image *image,ExceptionInfo *exception)
234</pre>
235
236<p>A description of each parameter follows.</p>
237
238<dt>image</dt>
239<p>the image.</p>
240
241<dt>exception</dt>
242<p>return any errors or warnings in this structure.</p>
243
244</div>
245    </div>
246  </main><!-- /.container -->
247  <footer class="magick-footer">
248    <p><a href="../../www/security-policy.html">Security</a> •
249    <a href="../../www/architecture.html">Architecture</a> •
250    <a href="../../www/links.html">Related</a> •
251     <a href="../../www/sitemap.html">Sitemap</a>
252
253    <a href="histogram.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../../images/wand.ico"/></a>
254
255    <a href="http://pgp.mit.edu/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
256    <a href="../../www/support.html">Donate</a> •
257    <a href="../../www/contact.html">Contact Us</a>
258    <br/>
259    <small>© 1999-2019 ImageMagick Studio LLC</small></p>
260  </footer>
261
262  <!-- Javascript assets -->
263  <script src="../assets/magick.js" crossorigin="anonymous"></script>
264  <script>window.jQuery || document.write('<script src="https://localhost/ajax/libs/jquery/3.3.1/jquery.min.js"><\/script>')</script>
265</body>
266</html>
267<!-- Magick Cache 2nd January 2019 17:24 -->