blob: da55b653987e4470686242d4582cba1aec77bf16 [file] [log] [blame]
cristy29dc8652015-05-12 16:26:21 +00001<!DOCTYPE html>
cristy44443b92015-05-05 00:06:07 +00002<html lang="en">
cristy06f63f22012-10-31 00:50:07 +00003<head>
Cristy36421ee2015-08-28 11:58:20 -04004
cristy29f2c972015-07-28 13:37:46 +00005 <title>ImageMagick: MagickCore, C API for ImageMagick: Colormap Methods</title>
cristy44443b92015-05-05 00:06:07 +00006 <meta http-equiv="content-type" content="text/html; charset=utf-8">
cristy44443b92015-05-05 00:06:07 +00007 <meta name="application-name" content="ImageMagick">
8 <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.">
9 <meta name="application-url" content="http://www.imagemagick.org">
10 <meta name="generator" content="PHP">
11 <meta name="keywords" content="magickcore, c, api, for, imagemagick:, colormap, methods, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert">
12 <meta name="rating" content="GENERAL">
13 <meta name="robots" content="INDEX, FOLLOW">
14 <meta name="generator" content="ImageMagick Studio LLC">
15 <meta name="author" content="ImageMagick Studio LLC">
16 <meta name="revisit-after" content="2 DAYS">
17 <meta name="resource-type" content="document">
cristy4e638cd2015-05-07 16:47:40 +000018 <meta name="copyright" content="Copyright (c) 1999-2015 ImageMagick Studio LLC">
cristy44443b92015-05-05 00:06:07 +000019 <meta name="distribution" content="Global">
20 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1">
cristy354f1172015-07-29 14:03:48 +000021 <link rel="icon" href="../images/wand.png">
22 <link rel="shortcut icon" href="../images/wand.ico">
23 <link rel="stylesheet" href="../css/magick.html">
cristy06f63f22012-10-31 00:50:07 +000024</head>
cristy44443b92015-05-05 00:06:07 +000025<body>
cristy06f63f22012-10-31 00:50:07 +000026<div class="main">
cristy44443b92015-05-05 00:06:07 +000027<div class="magick-masthead">
28 <div class="container">
Cristy542697a2015-10-12 20:10:32 -040029 <script async="async" src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3129977114552745" data-ad-slot="6345125851" data-ad-format="auto"></ins>
cristy29f2c972015-07-28 13:37:46 +000030 <script>
Cristy542697a2015-10-12 20:10:32 -040031 (adsbygoogle = window.adsbygoogle || []).push({});
cristy44443b92015-05-05 00:06:07 +000032 </script>
cristy44443b92015-05-05 00:06:07 +000033 <nav class="magick-nav">
cristy2f563d42015-05-06 23:36:51 +000034 <a class="magick-nav-item " href="../index.html">Home</a>
cristyea2793e2015-05-31 16:52:26 +000035 <a class="magick-nav-item " href="../binary-releases.html">Download</a>
cristy38185362015-05-07 20:09:56 +000036 <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>
cristyea2793e2015-05-31 16:52:26 +000038 <a class="magick-nav-item " href="../resources.html">Resources</a>
39 <a class="magick-nav-item " href="api.html">Develop</a>
cristy5b8fe762015-06-09 16:24:03 +000040 <a class="magick-nav-item " href="http://nextgen.imagemagick.org/script/search.php">Search</a>
cristya1890f02015-05-15 23:32:44 +000041 <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a>
cristy44443b92015-05-05 00:06:07 +000042 </nav>
43 </div>
44</div>
45<div class="container">
cristy4e638cd2015-05-07 16:47:40 +000046<div class="magick-header">
cristy99513ee2015-06-21 00:00:03 +000047<p class="text-center"><a href="colormap.html#AcquireImageColormap">AcquireImageColormap</a><a href="colormap.html#CycleColormap">CycleColormap</a></p>
cristy06f63f22012-10-31 00:50:07 +000048
cristycecc9492015-06-09 16:53:50 +000049<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/colormap_8c.html" id="AcquireImageColormap">AcquireImageColormap</a></h2>
50
51<p>AcquireImageColormap() allocates an image colormap and initializes it to a linear gray colorspace. If the image already has a colormap, it is replaced. AcquireImageColormap() returns MagickTrue if successful, otherwise MagickFalse if there is not enough memory.</p>
52
53<p>The format of the AcquireImageColormap method is:</p>
54
55<pre class="text">
56MagickBooleanType AcquireImageColormap(Image *image,const size_t colors,
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>image</dt>
68<dd>the image. </dd>
69
70<dd> </dd>
71<dt>colors</dt>
72<dd>the number of colors in the image colormap. </dd>
73
74<dd> </dd>
75<dt>exception</dt>
76<dd>return any errors or warnings in this structure. </dd>
77
78<dd> </dd>
79</dl>
80<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/colormap_8c.html" id="CycleColormap">CycleColormap</a></h2>
81
82<p>CycleColormap() displaces an image's colormap by a given number of positions. If you cycle the colormap a number of times you can produce a psychodelic effect.</p>
83
84<p>WARNING: this assumes an images colormap is in a well know and defined order. Currently Imagemagick has no way of setting that order.</p>
85
86<p>The format of the CycleColormapImage method is:</p>
87
88<pre class="text">
89MagickBooleanType CycleColormapImage(Image *image,const ssize_t displace,
90 ExceptionInfo *exception)
91</pre>
92
93<p>A description of each parameter follows:</p>
94
95<dd>
96</dd>
97
98<dd> </dd>
99<dl class="dl-horizontal">
100<dt>image</dt>
101<dd>the image. </dd>
102
103<dd> </dd>
104<dt>displace</dt>
105<dd> displace the colormap this amount. </dd>
106
107<dd> </dd>
108<dt>exception</dt>
109<dd>return any errors or warnings in this structure. </dd>
110
111<dd> </dd>
112</dl>
cristy06f63f22012-10-31 00:50:07 +0000113</div>
cristy44443b92015-05-05 00:06:07 +0000114 <footer class="magick-footer">
cristy29f2c972015-07-28 13:37:46 +0000115 <p><a href="../support.html">Donate</a>
116 <a href="../sitemap.html">Sitemap</a>
cristy38185362015-05-07 20:09:56 +0000117 <a href="../links.html">Related</a>
cristy29f2c972015-07-28 13:37:46 +0000118 <a href="../architecture.html">Architecture</a>
cristy44443b92015-05-05 00:06:07 +0000119</p>
120 <p><a href="colormap.html#">Back to top</a>
cristyea2793e2015-05-31 16:52:26 +0000121 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a>
cristy5b8fe762015-06-09 16:24:03 +0000122 <a href="http://nextgen.imagemagick.org/script/contact.php">Contact Us</a></p>
Cristy36421ee2015-08-28 11:58:20 -0400123 <p><small>© 1999-2015 ImageMagick Studio LLC</small></p>
cristy44443b92015-05-05 00:06:07 +0000124 </footer>
125</div><!-- /.container -->
cristy06f63f22012-10-31 00:50:07 +0000126
Cristy542697a2015-10-12 20:10:32 -0400127 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
cristy29f2c972015-07-28 13:37:46 +0000128 <script src="http://nextgen.imagemagick.org/js/magick.html"></script>
cristy44cbd482013-08-04 20:53:36 +0000129</div>
cristy06f63f22012-10-31 00:50:07 +0000130</body>
cristy5a367e42015-05-05 12:39:18 +0000131</html>