cristy | 29dc865 | 2015-05-12 16:26:21 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 2 | <html lang="en"> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 3 | <head> |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame^] | 4 | <title>ImageMagick: MagickCore, C API for ImageMagick: Count the Colors in an Image</title> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 5 | <meta http-equiv="content-type" content="text/html; charset=utf-8"> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 6 | <meta name="application-name" content="ImageMagick"> |
| 7 | <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."> |
| 8 | <meta name="application-url" content="http://www.imagemagick.org"> |
| 9 | <meta name="generator" content="PHP"> |
| 10 | <meta name="keywords" content="magickcore, c, api, for, imagemagick:, count, the, colors, in, an, image, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert"> |
| 11 | <meta name="rating" content="GENERAL"> |
| 12 | <meta name="robots" content="INDEX, FOLLOW"> |
| 13 | <meta name="generator" content="ImageMagick Studio LLC"> |
| 14 | <meta name="author" content="ImageMagick Studio LLC"> |
| 15 | <meta name="revisit-after" content="2 DAYS"> |
| 16 | <meta name="resource-type" content="document"> |
cristy | 4e638cd | 2015-05-07 16:47:40 +0000 | [diff] [blame] | 17 | <meta name="copyright" content="Copyright (c) 1999-2015 ImageMagick Studio LLC"> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 18 | <meta name="distribution" content="Global"> |
| 19 | <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"> |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame^] | 20 | <link href="../images/wand.png" rel="icon"> |
| 21 | <link href="../images/wand.ico" type="images/x-icon" rel="shortcut icon"> |
| 22 | <link href="../css/magick.html" rel="stylesheet"> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 23 | </head> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 24 | <body> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 25 | <div class="main"> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 26 | <div class="magick-masthead"> |
| 27 | <div class="container"> |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame^] | 28 | <script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> |
| 29 | <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3129977114552745" data-ad-slot="6345125851" data-ad-format="auto"></ins> |
| 30 | <script> |
| 31 | (adsbygoogle = window.adsbygoogle || []).push({}); |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 32 | </script> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 33 | <nav class="magick-nav"> |
cristy | 2f563d4 | 2015-05-06 23:36:51 +0000 | [diff] [blame] | 34 | <a class="magick-nav-item " href="../index.html">Home</a> |
cristy | ea2793e | 2015-05-31 16:52:26 +0000 | [diff] [blame] | 35 | <a class="magick-nav-item " href="../binary-releases.html">Download</a> |
cristy | 3818536 | 2015-05-07 20:09:56 +0000 | [diff] [blame] | 36 | <a class="magick-nav-item " href="../command-line-tools.html">Tools</a> |
| 37 | <a class="magick-nav-item " href="../command-line-options.html">Options</a> |
cristy | ea2793e | 2015-05-31 16:52:26 +0000 | [diff] [blame] | 38 | <a class="magick-nav-item " href="../resources.html">Resources</a> |
| 39 | <a class="magick-nav-item " href="api.html">Develop</a> |
cristy | 5b8fe76 | 2015-06-09 16:24:03 +0000 | [diff] [blame] | 40 | <a class="magick-nav-item " href="http://nextgen.imagemagick.org/script/search.php">Search</a> |
cristy | a1890f0 | 2015-05-15 23:32:44 +0000 | [diff] [blame] | 41 | <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 42 | </nav> |
| 43 | </div> |
| 44 | </div> |
| 45 | <div class="container"> |
cristy | 4e638cd | 2015-05-07 16:47:40 +0000 | [diff] [blame] | 46 | <div class="magick-header"> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 47 | <p class="text-center"><a href="color.html#AcquireColorCache">AcquireColorCache</a> • <a href="color.html#GetColorInfoList">GetColorInfoList</a> • <a href="color.html#GetColorList">GetColorList</a> • <a href="color.html#ListColorInfo">ListColorInfo</a> • <a href="color.html#QueryColorname">QueryColorname</a></p> |
| 48 | |
| 49 | <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/color_8c.html" id="AcquireColorCache">AcquireColorCache</a></h2> |
| 50 | |
| 51 | <p>AcquireColorCache() caches one or more color configurations which provides a mapping between color attributes and a color name.</p> |
| 52 | |
| 53 | <p>The format of the AcquireColorCache method is:</p> |
| 54 | |
| 55 | <pre class="text"> |
| 56 | LinkedListInfo *AcquireColorCache(const char *filename, |
| 57 | ExceptionInfo *exception) |
| 58 | </pre> |
| 59 | |
| 60 | <p>A description of each parameter follows:</p> |
| 61 | |
| 62 | <dd> |
| 63 | </dd> |
| 64 | |
| 65 | <dd> </dd> |
| 66 | <dl class="dl-horizontal"> |
| 67 | <dt>filename</dt> |
| 68 | <dd>the font file name. </dd> |
| 69 | |
| 70 | <dd> </dd> |
| 71 | <dt>exception</dt> |
| 72 | <dd>return any errors or warnings in this structure. </dd> |
| 73 | |
| 74 | <dd> </dd> |
| 75 | </dl> |
| 76 | <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/color_8c.html" id="GetColorInfoList">GetColorInfoList</a></h2> |
| 77 | |
| 78 | <p>GetColorInfoList() returns any colors that match the specified pattern.</p> |
| 79 | |
| 80 | <p>The format of the GetColorInfoList function is:</p> |
| 81 | |
| 82 | <pre class="text"> |
| 83 | const ColorInfo **GetColorInfoList(const char *pattern, |
| 84 | size_t *number_colors,ExceptionInfo *exception) |
| 85 | </pre> |
| 86 | |
| 87 | <p>A description of each parameter follows:</p> |
| 88 | |
| 89 | <dd> |
| 90 | </dd> |
| 91 | |
| 92 | <dd> </dd> |
| 93 | <dl class="dl-horizontal"> |
| 94 | <dt>pattern</dt> |
| 95 | <dd>Specifies a pointer to a text string containing a pattern. </dd> |
| 96 | |
| 97 | <dd> </dd> |
| 98 | <dt>number_colors</dt> |
| 99 | <dd> This integer returns the number of colors in the list. </dd> |
| 100 | |
| 101 | <dd> </dd> |
| 102 | <dt>exception</dt> |
| 103 | <dd>return any errors or warnings in this structure. </dd> |
| 104 | |
| 105 | <dd> </dd> |
| 106 | </dl> |
| 107 | <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/color_8c.html" id="GetColorList">GetColorList</a></h2> |
| 108 | |
| 109 | <p>GetColorList() returns any colors that match the specified pattern.</p> |
| 110 | |
| 111 | <p>The format of the GetColorList function is:</p> |
| 112 | |
| 113 | <pre class="text"> |
| 114 | char **GetColorList(const char *pattern,size_t *number_colors, |
| 115 | ExceptionInfo *exception) |
| 116 | </pre> |
| 117 | |
| 118 | <p>A description of each parameter follows:</p> |
| 119 | |
| 120 | <dd> |
| 121 | </dd> |
| 122 | |
| 123 | <dd> </dd> |
| 124 | <dl class="dl-horizontal"> |
| 125 | <dt>pattern</dt> |
| 126 | <dd>Specifies a pointer to a text string containing a pattern. </dd> |
| 127 | |
| 128 | <dd> </dd> |
| 129 | <dt>number_colors</dt> |
| 130 | <dd> This integer returns the number of colors in the list. </dd> |
| 131 | |
| 132 | <dd> </dd> |
| 133 | <dt>exception</dt> |
| 134 | <dd>return any errors or warnings in this structure. </dd> |
| 135 | |
| 136 | <dd> </dd> |
| 137 | </dl> |
| 138 | <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/color_8c.html" id="ListColorInfo">ListColorInfo</a></h2> |
| 139 | |
| 140 | <p>ListColorInfo() lists color names to the specified file. Color names are a convenience. Rather than defining a color by its red, green, and blue intensities just use a color name such as white, blue, or yellow.</p> |
| 141 | |
| 142 | <p>The format of the ListColorInfo method is:</p> |
| 143 | |
| 144 | <pre class="text"> |
| 145 | MagickBooleanType ListColorInfo(FILE *file,ExceptionInfo *exception) |
| 146 | </pre> |
| 147 | |
| 148 | <p>A description of each parameter follows.</p> |
| 149 | |
| 150 | <dt>file</dt> |
| 151 | <p>List color names to this file handle.</p> |
| 152 | |
| 153 | <dt>exception</dt> |
| 154 | <p>return any errors or warnings in this structure.</p> |
| 155 | |
| 156 | <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/color_8c.html" id="QueryColorname">QueryColorname</a></h2> |
| 157 | |
| 158 | <p>QueryColorname() returns a named color for the given color intensity. If an exact match is not found, a hex value is returned instead. For example an intensity of rgb:(0,0,0) returns black whereas rgb:(223,223,223) returns #dfdfdf.</p> |
| 159 | |
| 160 | <p>UPDATE: the 'image' argument is no longer needed as all information should have been preset using GetPixelInfo().</p> |
| 161 | |
| 162 | <p>The format of the QueryColorname method is:</p> |
| 163 | |
| 164 | <pre class="text"> |
| 165 | MagickBooleanType QueryColorname(const Image *image, |
| 166 | const PixelInfo *color,const ComplianceType compliance,char *name, |
| 167 | ExceptionInfo *exception) |
| 168 | </pre> |
| 169 | |
| 170 | <p>A description of each parameter follows.</p> |
| 171 | |
| 172 | <dt>image</dt> |
| 173 | <p>the image. (not used! - color gets settings from GetPixelInfo()</p> |
| 174 | |
| 175 | <dt>color</dt> |
| 176 | <p>the color intensities.</p> |
| 177 | |
| 178 | <dt>Compliance</dt> |
| 179 | <p>Adhere to this color standard: SVG, X11, or XPM.</p> |
| 180 | |
| 181 | <dt>name</dt> |
| 182 | <p>Return the color name or hex value.</p> |
| 183 | |
| 184 | <dt>exception</dt> |
| 185 | <p>return any errors or warnings in this structure.</p> |
cristy | 2039843 | 2011-08-11 01:31:50 +0000 | [diff] [blame] | 186 | |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 187 | </div> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 188 | <footer class="magick-footer"> |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame^] | 189 | <p><a href="../support.html">Donate</a> • |
| 190 | <a href="../sitemap.html">Sitemap</a> • |
cristy | 3818536 | 2015-05-07 20:09:56 +0000 | [diff] [blame] | 191 | <a href="../links.html">Related</a> • |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame^] | 192 | <a href="../architecture.html">Architecture</a> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 193 | </p> |
| 194 | <p><a href="color.html#">Back to top</a> • |
cristy | ea2793e | 2015-05-31 16:52:26 +0000 | [diff] [blame] | 195 | <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> • |
cristy | 5b8fe76 | 2015-06-09 16:24:03 +0000 | [diff] [blame] | 196 | <a href="http://nextgen.imagemagick.org/script/contact.php">Contact Us</a></p> |
cristy | a1890f0 | 2015-05-15 23:32:44 +0000 | [diff] [blame] | 197 | <p><small>© 1999-2015 ImageMagick Studio LLC</small></p> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 198 | </footer> |
| 199 | </div><!-- /.container --> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 200 | |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 201 | <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame^] | 202 | <script src="http://nextgen.imagemagick.org/js/magick.html"></script> |
cristy | 44cbd48 | 2013-08-04 20:53:36 +0000 | [diff] [blame] | 203 | </div> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 204 | </body> |
cristy | 5a367e4 | 2015-05-05 12:39:18 +0000 | [diff] [blame] | 205 | </html> |