]> granicus.if.org Git - imagemagick/blob - www/api/histogram.html
Added missing calls to xmlFreeDoc to fix memory leak reported in #1766.
[imagemagick] / www / api / histogram.html
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>ImageMagick - MagickCore, C API: Image Histograms</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, 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-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="histogram.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" />
36 </head>
37 <body>
38   <header>
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>
43     </button>
44
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>
49       </li>
50       <li class="nav-item ">
51         <a class="nav-link" href="../www/download.html">Download</a>
52       </li>
53       <li class="nav-item ">
54         <a class="nav-link" href="../www/command-line-tools.html">Tools</a>
55       </li>
56       <li class="nav-item ">
57         <a class="nav-link" href="../www/command-line-processing.html">Command-line</a>
58       </li>
59       <li class="nav-item ">
60         <a class="nav-link" href="../www/resources.html">Resources</a>
61       </li>
62       <li class="nav-item ">
63         <a class="nav-link" href="../www/develop.html">Develop</a>
64       </li>
65       <li class="nav-item">
66         <a class="nav-link" target="_blank" href="../https://imagemagick.org/discourse-server//">Community</a>
67       </li>
68     </ul>
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>
72     </form>
73     </div>
74   </nav>
75   <div class="container">
76    <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
77          style="display:block"
78          data-ad-client="ca-pub-3129977114552745"
79          data-ad-slot="6345125851"
80          data-ad-format="auto"></ins>
81     <script>
82       (adsbygoogle = window.adsbygoogle || []).push({});
83     </script>
84
85   </div>
86   </header>
87   <main class="container">
88     <div class="magick-template">
89 <div class="magick-header">
90 <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>
91
92 <h2><a href="../../api/MagickCore/histogram_8c.html" id="GetImageHistogram">GetImageHistogram</a></h2>
93
94 <p>GetImageHistogram() returns the unique colors in an image.</p>
95
96 <p>The format of the GetImageHistogram method is:</p>
97
98 <pre class="text">
99 size_t GetImageHistogram(const Image *image,
100   size_t *number_colors,ExceptionInfo *exception)
101 </pre>
102
103 <p>A description of each parameter follows.</p>
104
105 <dt>image</dt>
106 <p>the image.</p>
107
108 <dt>file</dt>
109 <p>Write a histogram of the color distribution to this file handle.</p>
110
111 <dt>exception</dt>
112 <p>return any errors or warnings in this structure.</p>
113
114 <h2><a href="../../api/MagickCore/histogram_8c.html" id="IdentifyPaletteImage">IdentifyPaletteImage</a></h2>
115
116 <p>IdentifyPaletteImage() returns MagickTrue if the image has 256 unique colors or less.</p>
117
118 <p>The format of the IdentifyPaletteImage method is:</p>
119
120 <pre class="text">
121 MagickBooleanType IdentifyPaletteImage(const Image *image,
122   ExceptionInfo *exception)
123 </pre>
124
125 <p>A description of each parameter follows.</p>
126
127 <dt>image</dt>
128 <p>the image.</p>
129
130 <dt>exception</dt>
131 <p>return any errors or warnings in this structure.</p>
132
133 <h2><a href="../../api/MagickCore/histogram_8c.html" id="IsHistogramImage">IsHistogramImage</a></h2>
134
135 <p>IsHistogramImage() returns MagickTrue if the image has 1024 unique colors or less.</p>
136
137 <p>The format of the IsHistogramImage method is:</p>
138
139 <pre class="text">
140 MagickBooleanType IsHistogramImage(const Image *image,
141   ExceptionInfo *exception)
142 </pre>
143
144 <p>A description of each parameter follows.</p>
145
146 <dt>image</dt>
147 <p>the image.</p>
148
149 <dt>exception</dt>
150 <p>return any errors or warnings in this structure.</p>
151
152 <h2><a href="../../api/MagickCore/histogram_8c.html" id="IsPaletteImage">IsPaletteImage</a></h2>
153
154 <p>IsPaletteImage() returns MagickTrue if the image is PseudoClass and has 256 unique colors or less.</p>
155
156 <p>The format of the IsPaletteImage method is:</p>
157
158 <pre class="text">
159 MagickBooleanType IsPaletteImage(const Image *image)
160 </pre>
161
162 <p>A description of each parameter follows.</p>
163
164 <dt>image</dt>
165 <p>the image.</p>
166
167 <h2><a href="../../api/MagickCore/histogram_8c.html" id="MinMaxStretchImage">MinMaxStretchImage</a></h2>
168
169 <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>
170
171 <p>If the adjustment values are both zero this function is equivalent to a perfect normalization (or autolevel) of the image.</p>
172
173 <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>
174
175 <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>
176
177 <p>The 'SyncChannels' is turned on in the 'DefaultChannels' setting by default.</p>
178
179 <p>The format of the MinMaxStretchImage method is:</p>
180
181 <pre class="text">
182 MagickBooleanType MinMaxStretchImage(Image *image,const double black,
183   const double white,const double gamma,ExceptionInfo *exception)
184 </pre>
185
186 <p>A description of each parameter follows:</p>
187
188 <dd>
189 </dd>
190
191 <dd> </dd>
192 <dl class="dl-horizontal">
193 <dt>image</dt>
194 <dd>The image to auto-level </dd>
195
196 <dd> </dd>
197 <dt>black, white</dt>
198 <dd> move the black / white point inward from the minimum and maximum points by this color value. </dd>
199
200 <dd> </dd>
201 <dt>gamma</dt>
202 <dd>the gamma. </dd>
203
204 <dd> </dd>
205 <dt>exception</dt>
206 <dd>return any errors or warnings in this structure. </dd>
207
208 <dd>  </dd>
209 </dl>
210 <h2><a href="../../api/MagickCore/histogram_8c.html" id="GetNumberColors">GetNumberColors</a></h2>
211
212 <p>GetNumberColors() returns the number of unique colors in an image.</p>
213
214 <p>The format of the GetNumberColors method is:</p>
215
216 <pre class="text">
217 size_t GetNumberColors(const Image *image,FILE *file,
218   ExceptionInfo *exception)
219 </pre>
220
221 <p>A description of each parameter follows.</p>
222
223 <dt>image</dt>
224 <p>the image.</p>
225
226 <dt>file</dt>
227 <p>Write a histogram of the color distribution to this file handle.</p>
228
229 <dt>exception</dt>
230 <p>return any errors or warnings in this structure.</p>
231
232 <h2><a href="../../api/MagickCore/histogram_8c.html" id="UniqueImageColors">UniqueImageColors</a></h2>
233
234 <p>UniqueImageColors() returns the unique colors of an image.</p>
235
236 <p>The format of the UniqueImageColors method is:</p>
237
238 <pre class="text">
239 Image *UniqueImageColors(const Image *image,ExceptionInfo *exception)
240 </pre>
241
242 <p>A description of each parameter follows.</p>
243
244 <dt>image</dt>
245 <p>the image.</p>
246
247 <dt>exception</dt>
248 <p>return any errors or warnings in this structure.</p>
249
250 </div>
251     </div>
252   </main><!-- /.container -->
253   <footer class="magick-footer">
254     <p><a href="../www/security-policy.html">Security</a> •
255     <a href="../www/architecture.html">Architecture</a>
256      
257     <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>
258      
259     <a href="../www/links.html">Related</a> •
260      <a href="../www/sitemap.html">Sitemap</a>
261     <br/>
262     <a href="../www/support.html">Donate</a> •
263     <a href="http://pgp.mit.edu/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
264     <a href="../www/contact.html">Contact Us</a> 
265     <br/>
266     <small>© 1999-2019 ImageMagick Studio LLC</small></p>
267   </footer>
268
269   <!-- Javascript assets -->
270   <script src="assets/magick.js" crossorigin="anonymous"></script>
271   <script>window.jQuery || document.write('<script src="https://localhost/ajax/libs/jquery/3.3.1/jquery.min.js"><\/script>')</script>
272 </body>
273 </html>
274 <!-- Magick Cache 25th April 2019 20:06 -->