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" />
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="histogram.html#GetImageHistogram">GetImageHistogram</a> • <a href="histogram.html#IdentifyPaletteImage">IdentifyPaletteImage</a> • <a href="histogram.html#IsHistogramImage">IsHistogramImage</a> • <a href="histogram.html#IsPaletteImage">IsPaletteImage</a> • <a href="histogram.html#MinMaxStretchImage">MinMaxStretchImage</a> • <a href="histogram.html#GetNumberColors">GetNumberColors</a> • <a href="histogram.html#UniqueImageColors">UniqueImageColors</a></p>
92 <h2><a href="../../api/MagickCore/histogram_8c.html" id="GetImageHistogram">GetImageHistogram</a></h2>
94 <p>GetImageHistogram() returns the unique colors in an image.</p>
96 <p>The format of the GetImageHistogram method is:</p>
99 size_t GetImageHistogram(const Image *image,
100 size_t *number_colors,ExceptionInfo *exception)
103 <p>A description of each parameter follows.</p>
109 <p>Write a histogram of the color distribution to this file handle.</p>
112 <p>return any errors or warnings in this structure.</p>
114 <h2><a href="../../api/MagickCore/histogram_8c.html" id="IdentifyPaletteImage">IdentifyPaletteImage</a></h2>
116 <p>IdentifyPaletteImage() returns MagickTrue if the image has 256 unique colors or less.</p>
118 <p>The format of the IdentifyPaletteImage method is:</p>
121 MagickBooleanType IdentifyPaletteImage(const Image *image,
122 ExceptionInfo *exception)
125 <p>A description of each parameter follows.</p>
131 <p>return any errors or warnings in this structure.</p>
133 <h2><a href="../../api/MagickCore/histogram_8c.html" id="IsHistogramImage">IsHistogramImage</a></h2>
135 <p>IsHistogramImage() returns MagickTrue if the image has 1024 unique colors or less.</p>
137 <p>The format of the IsHistogramImage method is:</p>
140 MagickBooleanType IsHistogramImage(const Image *image,
141 ExceptionInfo *exception)
144 <p>A description of each parameter follows.</p>
150 <p>return any errors or warnings in this structure.</p>
152 <h2><a href="../../api/MagickCore/histogram_8c.html" id="IsPaletteImage">IsPaletteImage</a></h2>
154 <p>IsPaletteImage() returns MagickTrue if the image is PseudoClass and has 256 unique colors or less.</p>
156 <p>The format of the IsPaletteImage method is:</p>
159 MagickBooleanType IsPaletteImage(const Image *image)
162 <p>A description of each parameter follows.</p>
167 <h2><a href="../../api/MagickCore/histogram_8c.html" id="MinMaxStretchImage">MinMaxStretchImage</a></h2>
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>
171 <p>If the adjustment values are both zero this function is equivalent to a perfect normalization (or autolevel) of the image.</p>
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>
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>
177 <p>The 'SyncChannels' is turned on in the 'DefaultChannels' setting by default.</p>
179 <p>The format of the MinMaxStretchImage method is:</p>
182 MagickBooleanType MinMaxStretchImage(Image *image,const double black,
183 const double white,const double gamma,ExceptionInfo *exception)
186 <p>A description of each parameter follows:</p>
192 <dl class="dl-horizontal">
194 <dd>The image to auto-level </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>
206 <dd>return any errors or warnings in this structure. </dd>
210 <h2><a href="../../api/MagickCore/histogram_8c.html" id="GetNumberColors">GetNumberColors</a></h2>
212 <p>GetNumberColors() returns the number of unique colors in an image.</p>
214 <p>The format of the GetNumberColors method is:</p>
217 size_t GetNumberColors(const Image *image,FILE *file,
218 ExceptionInfo *exception)
221 <p>A description of each parameter follows.</p>
227 <p>Write a histogram of the color distribution to this file handle.</p>
230 <p>return any errors or warnings in this structure.</p>
232 <h2><a href="../../api/MagickCore/histogram_8c.html" id="UniqueImageColors">UniqueImageColors</a></h2>
234 <p>UniqueImageColors() returns the unique colors of an image.</p>
236 <p>The format of the UniqueImageColors method is:</p>
239 Image *UniqueImageColors(const Image *image,ExceptionInfo *exception)
242 <p>A description of each parameter follows.</p>
248 <p>return any errors or warnings in this structure.</p>
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>
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>
259 <a href="../www/links.html">Related</a> •
260 <a href="../www/sitemap.html">Sitemap</a>
262 <a href="../www/support.html">Donate</a> •
263 <a href="http://pgp.mit.edu/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> •
264 <a href="../www/contact.html">Contact Us</a>
266 <small>© 1999-2019 ImageMagick Studio LLC</small></p>
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>
274 <!-- Magick Cache 25th April 2019 20:06 -->