1 <?xml version="1.0" encoding="utf-8" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <title>Magick++ API: STL Templates</title>
7 <link rel="stylesheet" href="https://www.imagemagick.org/Magick++/magick.css" type="text/css" />
10 <div class="doc-section">
11 <h1> Magick++ STL Support</h1>
12 Magick++ provides a set of <a href="http://www.sgi.com/tech/stl/">Standard
13 Template Libary</a> (<a href="http://www.sgi.com/tech/stl/">STL</a> )
14 algorithms for operating across ranges of image frames in a container.
15 It also provides a set of STL unary function objects to apply an
16 operation on image frames in a container via an algorithm which uses
17 unary function objects. A good example of a standard algorithm which is
18 useful for processing containers of image frames is the STL <i><a
19 href="http://www.sgi.com/tech/stl/for_each.html"> for_each</a> </i>
20 algorithm which invokes a unary function object on a range of container
22 <p>Magick++ uses a limited set of template argument types. The current
23 template argument types are: </p>
24 <a href="http://www.sgi.com/tech/stl/Container.html">Container</a>
25 <blockquote>A container having the properties of a <a
26 href="http://www.sgi.com/tech/stl/BackInsertionSequence.html"> Back
27 Insertion Sequence</a> . Sequences support forward iterators and Back
28 Insertion Sequences support the additional abilty to append an element
29 via push_back(). Common compatable container types are the STL <<a
30 href="http://www.sgi.com/tech/stl/Vector.html"> vector</a> > and <<a
31 href="http://www.sgi.com/tech/stl/List.html">list</a> > template
32 containers. This template argument is usually used to represent an
33 output container in which one or more image frames may be appended.
34 Containers like STL <<a href="http://www.sgi.com/tech/stl/Vector.html">vector</a>
35 > which have a given default <i>capacity</i> may need to have their <i>
36 capacity</i> adjusted via r<i>eserve() </i>to a larger <i>capacity</i>
37 in order to support the expected final <i>size</i> . Since Magick++
38 images are very small, it is likely that the default capacity of STL <<a
39 href="http://www.sgi.com/tech/stl/Vector.html"> vector</a> > is
40 sufficient for most situations.</blockquote>
41 <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
42 <blockquote>An input iterator used to express a position in a
43 container. These template arguments are typically used to represent a
44 range of elements with f<i>irst_</i> representing the first element to
45 be processed and <i> last_</i> representing the element to stop at. When
46 processing the entire contents of a container, it is handy to know that
47 STL containers usually provide the begin() and end() methods to return
48 input interators which correspond with the first and last elements,
49 respectively.</blockquote>
50 <p>The following is an example of how frames from a GIF animation <font
51 color="#000000"> "test_image_anim.gif" may be appended horizontally
52 with the resulting image written to the file <kbd>appended_image.miff</kbd>:</font></p>
55 #include <Magick++.h>
57 using namespace Magick;
59 int main(int /*argc*/,char **/*argv*/)
61 list<Image> imageList;
62 readImages( &imageList, "test_image_anim.gif" );
65 appendImages( &appended, imageList.begin(), imageList.end() );
66 appended.write( "appended_image.miff" );
70 <p>The available Magick++ specific STL algorithms for operating on
71 sequences of image frames are shown in the following table: <br />
73 <ul><table border="1" width="100%">
74 <caption><b>Magick++ STL Algorithms For Image Sequences</b></caption> <tbody>
77 <center><b>Algorithm</b></center>
80 <center><b>Signature</b></center>
83 <center><b>Description</b></center>
88 <center><a name="animateImages"></a> <font size="-1">animateImages</font></center>
90 <td><font size="-1"><a
91 href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a>
92 first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
94 <td><font size="-1">Animate a sequence of image frames. Image
95 frames are displayed in succession, creating an animated effect. The
96 animation options are taken from the first image frame. This feature is
97 only supported under X11 at the moment.</font></td>
101 <center><a name="appendImages"></a> <font size="-1">appendImages</font></center>
103 <td><font size="-1"><a href="https://www.imagemagick.org/Magick++/Image++.html">Image</a>
105 href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a>
106 first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
107 last_, bool stack_ = false</font></td>
108 <td><font size="-1">Append a sequence of image frames, writing
109 the result to <i>appendedImage_.</i> All the input image frames must
110 have the same width or height. Image frames of the same width are
111 stacked top-to-bottom. Image frames of the same height are stacked
112 left-to-right. If the <i>stack_</i> parameter is false, rectangular
113 image frames are stacked left-to-right otherwise top-to-bottom.</font></td>
117 <center><a name="averageImages"></a> <font size="-1">averageImages</font></center>
119 <td><font size="-1"><a href="https://www.imagemagick.org/Magick++/Image++.html">Image</a>
121 href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a>
122 first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
124 <td><font size="-1">Average a sequence of image frames, writing
125 the result to <i>averagedImage_</i>. All the input image frames must
126 be the same size in pixels.</font></td>
130 <center><a name="coalesceImages"></a> <font size="-1">coalesceImages</font></center>
132 <td><font size="-1"><a
133 href="http://www.sgi.com/tech/stl/Container.html"> Container</a>
134 *coalescedImages_, <a
135 href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a>
136 first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
139 <td><font size="-1">Create a coalesced image sequence obtained by
140 "playing" the image sequence (observing page offsets and disposal
141 methods) to create a new image sequence in which all frames are full
142 size and completely rendered. Note that if the original image sequence
143 relied on page offsets and disposal methods that the resulting sequence
144 will be larger (perhaps much larger) then the original. This is useful
145 for GIF animation sequences that have page offsets and disposal methods.
146 The resuting image sequence is returned via <i>coalescedImages_.</i></font></td>
150 <center><a name="deconstructImages"></a> <font size="-1">deconstructImages</font></center>
152 <td><font size="-1"><a
153 href="http://www.sgi.com/tech/stl/Container.html"> Container</a>
154 *deconstructedImages_, <a
155 href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a>
156 first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
158 <td><font size="-1">Break down an image sequence into constituent
159 parts.  This is useful for creating GIF or MNG animation sequences.
160 The input sequence is specified by <i>first_</i> and <i>last_</i>, and
161 the deconstructed images are returned via <i>deconstructedImages_</i>.</font></td>
165 <center><a name="displayImages"></a> <font size="-1">displayImages</font></center>
167 <td><font size="-1"><a
168 href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a>
169 first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
171 <td><font size="-1">Display a sequence of image frames. Through
172 use of a pop-up menu, image frames may be selected in succession. This
173 feature is fully supported under X11 but may have only limited support
174 in other environments.</font> <br />
175 <font size="-1"><b><font color="#ff0000">Caution: </font></b> if
176 an image format is is not compatable with the display visual (e.g. JPEG
177 on a colormapped display) then the original image will be altered. Use a
178 copy of the original if this is a problem.</font></td>
182 <center><a name="flattenImages"></a> <font size="-1">flattenImages</font></center>
184 <td><font size="-1"><a href="https://www.imagemagick.org/Magick++/Image++.html">Image</a>
186 href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a>
187 first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
189 <td><font size="-1">Merge a sequence of image frames which
190 represent image layers into a single composited representation. The <i>flattendImage_</i>
191 parameter points to an existing Image to update with the flattened
192 image. This function is useful for combining Photoshop layers into a
193 single image.</font></td>
197 <center><a name="forwardFourierTransformImage"></a> <font size="-1">forwardFourierTransformImage</font></center>
199 <td><font size="-1"><a
200 href="http://www.sgi.com/tech/stl/Container.html"> Container</a>
201 *fourierImages_, const Image &image_ </font></td>
202 <td><font size="-1"> Implements the discrete Fourier transform (DFT) of the image as a magnitude / phase image pair via <i>fourierImages_</i>.</font></td>
206 <center><a name="forwardFourierTransformImage"></a> <font size="-1">forwardFourierTransformImage</font></center>
208 <td><font size="-1"><a
209 href="http://www.sgi.com/tech/stl/Container.html"> Container</a>
210 *fourierImages_, const Image &image_, const bool magnitude_ </font></td>
211 <td><font size="-1"> Implements the discrete Fourier transform (DFT) of the image either as a magnitude / phase or real / imaginary image pair via <i>fourierImages_</i>.</font></td>
215 <center><a name="mapImages"></a> <font size="-1">mapImages</font></center>
217 <td><font size="-1"><a
218 href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a>
219 first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
220 last_, const <a href="https://www.imagemagick.org/Magick++/Image++.html">Image</a> & mapImage_, bool
221 dither_,  bool measureError_ = false</font></td>
222 <td><font size="-1">Replace the colors of a sequence of images
223 with the closest color from a reference image. Set <i>dither_</i> to <i>true</i>
224 to enable dithering.  Set <i>measureError_</i> to <i>true</i> in
225 order to evaluate quantization error.</font></td>
229 <center><a name="montageImages"></a> <font size="-1">montageImages</font></center>
231 <td><font size="-1"><a
232 href="http://www.sgi.com/tech/stl/Container.html"> Container</a>
234 href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a>
235 first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
236 last_, const <a href="Montage.html">Montage</a> &montageOpts_</font></td>
237 <td><font size="-1">Create a composite image by combining several
238 separate image frames. Multiple frames may be generated in the output
239 container <i> montageImages_ </i>depending on the tile setting and the
240 number of image frames montaged. Montage options are provided via the
241 parameter <i>montageOpts_</i> . Options set in the first image frame (<a
242 href="https://www.imagemagick.org/Magick++/Image++.html#backgroundColor"> backgroundColor,</a> <a
243 href="https://www.imagemagick.org/Magick++/Image++.html#borderColor">borderColor</a> , <a
244 href="https://www.imagemagick.org/Magick++/Image++.html#matteColor">matteColor</a> , <a
245 href="https://www.imagemagick.org/Magick++/Image++.html#penColor">penColor,</a> <a href="https://www.imagemagick.org/Magick++/Image++.html#font">font,</a>
246 and <a href="https://www.imagemagick.org/Magick++/Image++.html#fontPointsize">fontPointsize</a> ) are also used
247 as options by <i>montageImages().</i></font></td>
251 <center><a name="morphImages"></a> <font size="-1">morphImages</font></center>
253 <td><font size="-1"><a
254 href="http://www.sgi.com/tech/stl/Container.html"> Container</a>
256 href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a>
257 first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
258 last_, size_t frames_</font></td>
259 <td><font size="-1">Morph a seqence of image frames. This
260 algorithm  expands the number of image frames (output to the
261 container <i>morphedImages_)</i> by adding the number of intervening
262 frames specified by <i>frames_</i> such that the original frames morph
263 (blend) into each other when played as an animation.</font></td>
267 <center><a name="mosaicImages"></a> <font size="-1">mosaicImages</font></center>
269 <td><font size="-1"><a href="https://www.imagemagick.org/Magick++/Image++.html">Image</a> *mosaicImage_, <a
270 href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a>
271 first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
273 <td><font size="-1">Inlay a number of images to form a single
274 coherent picture. The <i>mosicImage_</i> argument is updated with a
275 mosaic constructed from the image sequence represented by <i>first_</i>
276 through <i>last_</i> .</font></td>
279 <td><center><a name="quantizeImages"></a> <font size="-1">quantizeImages</font></center></td>
280 <td><font size="-1"><a
281 href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a>
282 first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
283 last_, bool measureError_ = false</font></td>
284 <td><font size="-1">Quantize colors in images using current
285 quantization settings. Set <i>measureError_</i> to <i>true</i> in order
286 to measure quantization error.</font></td>
290 <center><a name="readImages"></a> <font size="-1">readImages</font></center>
292 <td><font size="-1"><a
293 href="http://www.sgi.com/tech/stl/Container.html"> Container</a>
294 *sequence_, const std::string &imageSpec_</font></td>
295 <td><font size="-1">Read a sequence of image frames into existing
296 container (appending to container <i>sequence_</i>) with image names
297 specified in the UTF-8 string <i>imageSpec_</i>.</font></td>
300 <td><font size="-1"><a
301 href="http://www.sgi.com/tech/stl/Container.html"> Container</a>
302 *sequence_, const <a href="Blob.html">Blob</a> &blob_</font></td>
303 <td><font size="-1">Read a sequence of image frames into existing
304 container (appending to container sequence_) from <a href="Blob.html">Blob</a>
309 <center><a name="writeImages"></a> <font size="-1">writeImages</font></center>
311 <td><font size="-1"><a
312 href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a>
313 first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
314 last_, const std::string &imageSpec_, bool adjoin_ = true</font></td>
315 <td><font size="-1">Write images in container to file specified
316 by string <i>imageSpec_</i>. Set <i>adjoin_ </i>to false to write a
317 set of image frames via a wildcard <i>imageSpec_ </i>(e.g.
318 image%02d.miff).</font> <br />
319 The wildcard must be one of <tt>%0Nd, %0No, or %0Nx</tt>. <br />
320 <font size="-1"><b><font color="#ff0000">Caution: </font></b> if
321 an image format is selected which is capable of supporting fewer colors
322 than the original image or quantization has been requested, the original
323 image will be quantized to fewer colors. Use a copy of the original if
324 this is a problem.</font></td>
327 <td><font size="-1"><a
328 href="http://www.sgi.com/tech/stl/InputIterator.html"> InputIterator</a>
329 first_, <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
330 last_, <a href="Blob.html">Blob</a> *blob_, bool adjoin_ = true</font></td>
331 <td><font size="-1">Write images in container to in-memory BLOB
332 specified by <a href="Blob.html">Blob</a> blob_. Set adjoin_ to false to
333 write a set of image frames via a wildcard imageSpec_ (e.g.
334 image%02d.miff).</font> <br />
335 <font size="-1"><b><font color="#ff0000">Caution:</font></b> if an
336 image format is selected which is capable of supporting fewer colors
337 than the original image or quantization has been requested, the original
338 image will be quantized to fewer colors. Use a copy of the original if
339 this is a problem.</font></td>
343 <p>In addition, we support these yet to be documented methods: <code>combineImages()</code>, <code>evaluateImages()</code>, <code>mergeImageLayers()</code>, <code>optimizeImageLayers()</code>, <code>optimizePlusImageLayers()</code>, and <code>separateImages()</code>.</p>
347 <h3> Magick++ Unary Function Objects</h3>
349 Magick++ unary function objects inherit from the STL unary_function
350 template class . The STL unary_function template class is of the form
351 <pre class="text"><tt><font color="#000099">unary_function<Arg, Result></font></tt></pre>
352 and expects that derived classes implement a method of the form:
353 <pre class="text"><tt><font color="#000099">Result operator()( Arg argument_);</font></tt></pre>
354 which is invoked by algorithms using the function object. In the case
355 of unary function objects defined by Magick++, the invoked function
357 <pre class="text"><tt><font color="#000099">void operator()( Image &image_);</font></tt></pre>
358 with a typical implementation looking similar to:
359 <pre class="text"><tt><font color="#000099">void operator()( Image &image_ )</font></tt> <br />
360 <tt><font color="#000099">  {</font></tt> <br />
361 <tt><font color="#000099">    image_.contrast(
362 _sharpen );</font></tt> <br />
363 <tt><font color="#000099">  }</font></tt></pre>
364 where <i>contrast</i> is an Image method and <i>_sharpen </i>is an
365 argument stored within the function object by its contructor. Since
366 constructors may be polymorphic, a given function object may have
367 several constructors and selects the appropriate Image method based on
368 the arguments supplied.
369 <p>In essence, unary function objects (as provided by Magick++) simply
370 provide the means to construct an object which caches arguments for
371 later use by an algorithm designed for use with unary function objects.
372 There is a unary function object corresponding each algorithm provided
373 by the <a href="https://www.imagemagick.org/Magick++/Image++.html"> Image</a> class and there is a contructor
374 available compatable with each synonymous method in the Image class. </p>
375 <p>The unary function objects that Magick++ provides to support
376 manipulating images are shown in the following table: <br />
378 <ul><table border="1">
379 <caption><b>Magick++ Unary Function Objects For Image Manipulation</b></caption> <tbody>
381 <td><b>Function Object</b></td>
382 <td><b>Constructor Signatures(s)</b></td>
383 <td><b>Description</b></td>
387 <div align="center"><a name="adaptiveThresholdImage"></a> <font
388 size="-1">adaptiveThresholdImage</font><br />
391 <td valign="middle"><font size="-1">size_t width, size_t
392 height, unsigned offset = 0</font><br />
394 <td valign="top"><font size="-1">Apply adaptive thresholding to
395 the image. Adaptive thresholding is useful if the ideal threshold level
396 is not known in advance, or if the illumination gradient is not constant
397 across the image. Adaptive thresholding works by evaulating the mean
398 (average) of a pixel region (size specified by <i>width</i> and <i>height</i>)
399 and using the mean as the thresholding value. In order to remove
400 residual noise from the background, the threshold may be adjusted by
401 subtracting a constant <i>offset</i> (default zero) from the mean to
402 compute the threshold.</font><br />
407 <center><a name="addNoiseImage"></a> <font size="-1">addNoiseImage</font></center>
409 <td><font size="-1"><a href="Enumerations.html#NoiseType">NoiseType</a>
410 noiseType_</font></td>
411 <td><font size="-1">Add noise to image with specified noise type.</font></td>
414 <td style="vertical-align: middle;"><small><a
415 name="affineTransformImage"></a>affineTransformImage<br />
417 <td style="vertical-align: middle;"><small>const DrawableAffine
420 <td style="vertical-align: middle;"><small>Transform image by
421 specified affine (or free transform) matrix.<br />
426 <center><a name="annotateImage"></a> <font size="-1">annotateImage</font></center>
428 <td><font size="-1">const std::string &text_, const <a
429 href="Geometry.html"> Geometry</a> &location_</font></td>
430 <td><font size="-1">Annotate with text using specified text,
431 bounding area, placement gravity, and rotation. If <i>boundingArea_</i>
432 is invalid, then bounding area is entire image.</font></td>
435 <td><font size="-1">std::string text_, const <a
436 href="Geometry.html">Geometry</a> &boundingArea_, <a
437 href="Enumerations.html#GravityType">GravityType</a> gravity_</font></td>
438 <td><font size="-1">Annotate using specified text, bounding area,
439 and placement gravity. If <i>boundingArea_</i> is invalid, then
440 bounding area is entire image.</font></td>
443 <td><font size="-1">const std::string &text_, const <a
444 href="Geometry.html"> Geometry</a> &boundingArea_, <a
445 href="Enumerations.html#GravityType">GravityType</a> gravity_, double
446 degrees_, </font></td>
447 <td><font size="-1">Annotate with text using specified text,
448 bounding area, placement gravity, and rotation. If <i>boundingArea_</i>
449 is invalid, then bounding area is entire image.</font></td>
452 <td><font size="-1">const std::string &text_, <a
453 href="Enumerations.html#GravityType"> GravityType</a> gravity_</font></td>
454 <td><font size="-1">Annotate with text (bounding area is entire
455 image) and placement gravity.</font></td>
459 <center><a name="blurImage"></a> <font size="-1">blurImage</font></center>
461 <td><font size="-1">const double radius_ = 1, const double sigma_
463 <td><font size="-1">Blur image. The radius_ parameter specifies
464 the radius of the Gaussian, in pixels, not counting the center
465 pixel.  The sigma_ parameter specifies the standard deviation of
466 the Laplacian, in pixels.</font></td>
470 <center><a name="borderImage"></a> <font size="-1">borderImage</font></center>
472 <td><font size="-1">const <a href="Geometry.html">Geometry</a>
473 &geometry_ = "6x6+0+0"</font></td>
474 <td><font size="-1">Border image (add border to image).  The
475 color of the border is specified by the <i>borderColor</i> attribute.</font></td>
479 <center><a name="charcoalImage"></a> <font size="-1">charcoalImage</font></center>
481 <td><font size="-1">const double radius_ = 1, const double sigma_
483 <td><font size="-1">Charcoal effect image (looks like charcoal
484 sketch). The radius_ parameter specifies the radius of the Gaussian, in
485 pixels, not counting the center pixel.  The sigma_ parameter
486 specifies the standard deviation of the Laplacian, in pixels.</font></td>
490 <center><a name="chopImage"></a> <font size="-1">chopImage</font></center>
492 <td><font size="-1">const <a href="Geometry.html">Geometry</a>
493 &geometry_</font></td>
494 <td><font size="-1">Chop image (remove vertical or horizontal
495 subregion of image)</font></td>
499 <center><a name="colorizeImage"></a> <font size="-1">colorizeImage</font></center>
501 <td><font size="-1">const size_t opacityRed_, const
502 size_t opacityGreen_, const size_t opacityBlue_, const Color
503 &penColor_</font></td>
504 <td><font size="-1">Colorize image with pen color, using
505 specified percent opacity for red, green, and blue quantums.</font></td>
508 <td><font size="-1">const size_t opacity_, const <a
509 href="Color.html"> Color</a> &penColor_</font></td>
510 <td><font size="-1">Colorize image with pen color, using
511 specified percent opacity.</font></td>
515 <center><a name="commentImage"></a> <font size="-1">commentImage</font></center>
517 <td><font size="-1">const std::string &comment_</font></td>
518 <td><font size="-1">Comment image (add comment string to
519 image).  By default, each image is commented with its file name.
520 Use  this  method to  assign a specific comment to the
521 image.  Optionally you can include the image filename, type, width,
522 height, or other  image  attributes by embedding <a
523 href="FormatCharacters.html">special format characters.</a> </font></td>
527 <center><a name="compositeImage"></a> <font size="-1">compositeImage</font></center>
529 <td><font size="-1">const <a href="https://www.imagemagick.org/Magick++/Image++.html">Image</a>
530 &compositeImage_, ssize_t xOffset_, ssize_t yOffset_, <a
531 href="Enumerations.html#CompositeOperator"> CompositeOperator</a>
532 compose_ = <i>InCompositeOp</i></font></td>
533 <td rowspan="2"><font size="-1">Compose an image onto another at
534 specified offset and using specified algorithm</font></td>
537 <td><font size="-1">const <a href="https://www.imagemagick.org/Magick++/Image++.html">Image</a>
538 &compositeImage_, const Geometry &offset_, <a
539 href="Enumerations.html#CompositeOperator"> CompositeOperator</a>
540 compose_ = <i>InCompositeOp</i></font></td>
544 <center><a name="condenseImage"></a> <font size="-1">condenseImage</font></center>
546 <td><font size="-1">void</font></td>
547 <td><font size="-1">Condense image (Re-run-length encode image in
552 <center><a name="contrastImage"></a> <font size="-1">contrastImage</font></center>
554 <td><font size="-1">size_t sharpen_</font></td>
555 <td><font size="-1">Contrast image (enhance intensity differences
556 in image)</font></td>
560 <center><a name="cropImage"></a> <font size="-1">cropImage</font></center>
562 <td><font size="-1">const <a href="Geometry.html">Geometry</a>
563 &geometry_</font></td>
564 <td><font size="-1">Crop image (subregion of original image)</font></td>
568 <center><a name="cycleColormapImage"></a> <font size="-1">cycleColormap-</font> <br />
569 <font size="-1">Image</font></center>
571 <td><font size="-1">int amount_</font></td>
572 <td><font size="-1">Cycle image colormap</font></td>
576 <center><a name="despeckleImage"></a> <font size="-1">despeckleImage</font></center>
578 <td><font size="-1">void</font></td>
579 <td><font size="-1">Despeckle image (reduce speckle noise)</font></td>
583 <center><a name="drawImage"></a> <font size="-1">drawImage</font></center>
585 <td><font size="-1">const <a href="Drawable.html">Drawable</a>
586 &drawable_</font></td>
587 <td><font size="-1">Draw shape or text on image.</font></td>
590 <td><font size="-1">const std::list<<a href="Drawable.html">Drawable</a>
591 > &drawable_</font></td>
592 <td><font size="-1">Draw shapes or text on image using a set of
593 Drawable objects contained in an STL list. Use of this method improves
594 drawing performance and allows batching draw objects together in a list
595 for repeated use.</font></td>
599 <center><a name="edgeImage"></a> <font size="-1">edgeImage</font></center>
601 <td><font size="-1">size_t radius_ = 0.0</font></td>
602 <td><font size="-1">Edge image (hilight edges in image). 
603 The radius is the radius of the pixel neighborhood.. Specify a radius
604 of zero for automatic radius selection.</font></td>
608 <center><a name="embossImage"></a> <font size="-1">embossImage</font></center>
610 <td><font size="-1">const double radius_ = 1, const double sigma_
612 <td><font size="-1">Emboss image (hilight edges with 3D effect).
613 The radius_ parameter specifies the radius of the Gaussian, in pixels,
614 not counting the center pixel.  The sigma_ parameter specifies the
615 standard deviation of the Laplacian, in pixels.</font></td>
619 <center><a name="enhanceImage"></a> <font size="-1">enhanceImage</font></center>
621 <td><font size="-1">void</font></td>
622 <td><font size="-1">Enhance image (minimize noise)</font></td>
626 <center><a name="equalizeImage"></a> <font size="-1">equalizeImage</font></center>
628 <td><font size="-1">void</font></td>
629 <td><font size="-1">Equalize image (histogram equalization)</font></td>
633 <center><a name="flipImage"></a> <font size="-1">flipImage</font></center>
635 <td><font size="-1">void</font></td>
636 <td><font size="-1">Flip image (reflect each scanline in the
637 vertical direction)</font></td>
641 <center><a name="floodFillColorImage"></a> <font size="-1">floodFill-</font> <br />
642 <font size="-1">ColorImage</font></center>
644 <td><font size="-1">ssize_t x_, ssize_t y_, const <a
645 href="Color.html"> Color</a> &fillColor_</font></td>
646 <td rowspan="2"><font size="-1">Flood-fill color across pixels
647 that match the color of the target pixel and are neighbors of the
648 target pixel. Uses current fuzz setting when determining color match.</font></td>
651 <td><font size="-1">const <a href="Geometry.html">Geometry</a>
652 &point_, const <a href="Color.html">Color</a> &fillColor_</font></td>
655 <td><font size="-1">ssize_t x_, ssize_t y_, const <a
656 href="Color.html"> Color</a> &fillColor_, const <a href="Color.html">Color</a>
657 &borderColor_</font></td>
658 <td rowspan="2"><font size="-1">Flood-fill color across pixels
659 starting at target-pixel and stopping at pixels matching specified
660 border color. Uses current fuzz setting when determining color match.</font></td>
663 <td><font size="-1">const <a href="Geometry.html">Geometry</a>
664 &point_, const <a href="Color.html">Color</a> &fillColor_, const <a
665 href="Color.html">Color</a> &borderColor_</font></td>
669 <center><a name="floodFillTextureImage"></a> <font size="-1">floodFill-</font> <br />
670 <font size="-1">TextureImage</font></center>
672 <td><font size="-1">ssize_t x_, ssize_t y_,  const <a
673 href="https://www.imagemagick.org/Magick++/Image++.html"> Image</a> &texture_</font></td>
674 <td rowspan="2"><font size="-1">Flood-fill texture across pixels
675 that match the color of the target pixel and are neighbors of the
676 target pixel. Uses current fuzz setting when determining color match.</font></td>
679 <td><font size="-1">const <a href="Geometry.html">Geometry</a>
680 &point_, const Image &texture_</font></td>
683 <td><font size="-1">ssize_t x_, ssize_t y_, const Image
684 &texture_, const <a href="Color.html">Color</a> &borderColor_</font></td>
685 <td rowspan="2"><font size="-1">Flood-fill texture across pixels
686 starting at target-pixel and stopping at pixels matching specified
687 border color. Uses current fuzz setting when determining color match.</font></td>
690 <td><font size="-1">const <a href="Geometry.html">Geometry</a>
691 &point_, const Image &texture_, const <a href="Color.html">Color</a>
692 &borderColor_</font></td>
696 <center><a name="flopImage"></a> <font size="-1">flopImage</font></center>
698 <td><font size="-1">void </font></td>
699 <td><font size="-1">Flop image (reflect each scanline in the
700 horizontal direction)</font></td>
704 <center><a name="frameImage"></a> <font size="-1">frameImage</font></center>
706 <td><font size="-1">const <a href="Geometry.html">Geometry</a>
707 &geometry_ = "25x25+6+6"</font></td>
708 <td rowspan="2"><font size="-1">Add decorative frame around image</font></td>
711 <td><font size="-1">size_t width_, size_t height_,
712 ssize_t x_, ssize_t y_, ssize_t innerBevel_ = 0, ssize_t outerBevel_ = 0</font></td>
716 <center><a name="gammaImage"></a> <font size="-1">gammaImage</font></center>
718 <td><font size="-1">double gamma_</font></td>
719 <td><font size="-1">Gamma correct image (uniform red, green, and
720 blue correction).</font></td>
723 <td><font size="-1">double gammaRed_, double gammaGreen_, double
724 gammaBlue_</font></td>
725 <td><font size="-1">Gamma correct red, green, and blue channels
726 of image.</font></td>
730 <center><a name="gaussianBlur"></a> <font size="-1">gaussianBlurImage</font></center>
732 <td><font size="-1">double width_, double sigma_</font></td>
733 <td><font size="-1">Gaussian blur image. The number of neighbor
734 pixels to be included in the convolution mask is specified by
735 'width_'.  For example, a width of one gives a (standard) 3x3
736 convolution mask. The standard deviation of the gaussian bell curve is
737 specified by 'sigma_'.</font></td>
741 <center><a name="implodeImage"></a> <font size="-1">implodeImage</font></center>
743 <td><font size="-1">double factor_</font></td>
744 <td><font size="-1">Implode image (special effect)</font></td>
748 <center><a name="inverseFourierTransformImage"></a> <font size="-1">inverseFourierTransformImage</font></center>
750 <td><font size="-1">const <a href="https://www.imagemagick.org/Magick++/Image++.html">Image</a>
751 &phaseImage_, const bool magnitude_</font></td>
752 <td><font size="-1">implements the inverse discrete Fourier transform (DFT) of the image either as a magnitude / phase or real / imaginary image pair.</font></td>
756 <center><a name="labelImage"></a> <font size="-1">labelImage</font></center>
758 <td><font size="-1">const string &label_</font></td>
759 <td><font size="-1">Assign a label to an image. Use this option
760 to  assign  a  specific label to the image. Optionally
761 you can include the image filename, type, width, height, or scene
762 number in the label by embedding  <a href="FormatCharacters.html">special
763 format characters.</a> If the first character of string is @, the image
764 label is read from a file titled by the remaining characters in the
765 string. When converting to Postscript, use this  option to specify
766 a header string to print above the image.</font></td>
769 <td style="text-align: center; vertical-align: middle;"><small><a
770 name="levelImage"></a>levelImage<br />
772 <td style="vertical-align: top;"><small>const double black_point,
773 const double white_point, const double mid_point=1.0<br />
775 <td style="vertical-align: top;"><small>Level image. Adjust the
776 levels of the image by scaling the colors falling between specified
777 white and black points to the full available quantum range. The
778 parameters provided represent the black, mid (gamma), and white
779 points.  The black point specifies the darkest color in the image.
780 Colors darker than the black point are set to zero. Mid point (gamma)
781 specifies a gamma correction to apply to the image. White point
782 specifies the lightest color in the image.  Colors brighter than
783 the white point are set to the maximum quantum value. The black and
784 white point have the valid range 0 to QuantumRange while mid (gamma) has a
785 useful range of 0 to ten.</small></td>
788 <td style="text-align: center; vertical-align: middle;"><small><a
789 name="levelChannelImage"></a>levelChannelImage<br />
791 <td style="vertical-align: top;"><small>const Magick::ChannelType
792 channel, const double black_point, const double white_point, const
793 double mid_point=1.0<br />
795 <td style="vertical-align: top;"><small>Level image channel.
796 Adjust the levels of the image channel by scaling the values falling
797 between specified white and black points to the full available quantum
798 range. The parameters provided represent the black, mid (gamma), and
799 white points. The black point specifies the darkest color in the image.
800 Colors darker than the black point are set to zero. Mid point (gamma)
801 specifies a gamma correction to apply to the image. White point
802 specifies the lightest color in the image. Colors brighter than the
803 white point are set to the maximum quantum value. The black and white
804 point have the valid range 0 to QuantumRange while mid (gamma) has a useful
805 range of 0 to ten.</small></td>
809 <center><a name="layerImage"></a> <font size="-1">layerImage</font></center>
811 <td><font size="-1"><a href="Enumerations.html#ChannelType">ChannelType</a>
813 <td><font size="-1">Extract layer from image. Use this option to
814 extract a particular layer from  the image.  <i>MatteLayer</i>, 
815 for  example, is useful for extracting the opacity values from an
820 <center><a name="magnifyImage"></a> <font size="-1">magnifyImage</font></center>
822 <td><font size="-1">void</font></td>
823 <td><font size="-1">Magnify image by integral size</font></td>
827 <center><a name="mapImage"></a> <font size="-1">mapImage</font></center>
829 <td><font size="-1">const <a href="https://www.imagemagick.org/Magick++/Image++.html">Image</a>
830 &mapImage_ , bool dither_ = false</font></td>
831 <td><font size="-1">Remap image colors with closest color from
832 reference image. Set dither_ to <i>true</i> in to apply Floyd/Steinberg
833 error diffusion to the image. By default, color reduction chooses an
834 optimal  set  of colors that best represent the original
835 image. Alternatively, you can  choose  a 
836 particular  set  of colors  from  an image file
837 with this option.</font></td>
841 <center><a name="matteFloodfillImage"></a> <font size="-1">matteFloodfill-</font> <br />
842 <font size="-1">Image</font></center>
844 <td><font size="-1">const <a href="Color.html">Color</a>
845 &target_, unsigned int matte_, ssize_t x_, ssize_t y_, <a
846 href="Enumerations.html#PaintMethod"> PaintMethod</a> method_</font></td>
847 <td><font size="-1">Floodfill designated area with a matte value</font></td>
850 <td><a name="medianFilterImage"></a> <font size="-1">medianFilterImage</font></td>
851 <td><font size="-1">const double radius_ = 0.0</font></td>
852 <td><font size="-1">Filter image by replacing each pixel
853 component with the median color in a circular neighborhood</font></td>
857 <center><a name="minifyImage"></a> <font size="-1">minifyImage</font></center>
859 <td><font size="-1">void</font></td>
860 <td><font size="-1">Reduce image by integral size</font></td>
864 <center><a name="modulateImage"></a> <font size="-1">modulateImage</font></center>
866 <td><font size="-1">double brightness_, double saturation_,
867 double hue_</font></td>
868 <td><font size="-1">Modulate percent hue, saturation, and
869 brightness of an image. </font><font size="-1">Modulation of
870 saturation and brightness is as a ratio of the current value (100.0 for no
871 change). Modulation of hue is an absolute rotation of -180 degrees to
872 +180 degrees from the current position corresponding to an argument
873 range of 0 to 200.0 (100.0 for no change).</font></td>
877 <center><a name="negateImage"></a> <font size="-1">negateImage</font></center>
879 <td><font size="-1">bool grayscale_ = false</font></td>
880 <td><font size="-1">Negate colors in image.  Replace every
881 pixel with its complementary color (white becomes black, yellow becomes
882 blue, etc.).  Set grayscale to only negate grayscale values in
887 <center><a name="normalizeImage"></a> <font size="-1">normalizeImage</font></center>
889 <td><font size="-1">void</font></td>
890 <td><font size="-1">Normalize image (increase contrast by
891 normalizing the pixel values to span the full range of color values).</font></td>
895 <center><a name="oilPaintImage"></a> <font size="-1">oilPaintImage</font></center>
897 <td><font size="-1">size_t radius_ = 3</font></td>
898 <td><font size="-1">Oilpaint image (image looks like oil painting)</font></td>
902 <center><a name="opacityImage"></a> <font size="-1">opacityImage</font></center>
904 <td><font size="-1">size_t opacity_</font></td>
905 <td><font size="-1">Set or attenuate the opacity channel in the
906 image. If the image pixels are opaque then they are set to the specified
907 opacity value, otherwise they are blended with the supplied opacity
908 value.  The value of opacity_ ranges from 0 (completely opaque) to <i>QuantumRange</i>.
909 The defines <i>OpaqueOpacity</i> and <i>TransparentOpacity</i> are
910 available to specify completely opaque or completely transparent,
911 respectively.</font></td>
915 <center><a name="opaqueImage"></a> <font size="-1">opaqueImage</font></center>
917 <td><font size="-1">const <a href="Color.html">Color</a>
918 &opaqueColor_, const <a href="Color.html">Color</a> &penColor_</font></td>
919 <td><font size="-1">Change color of pixels matching opaqueColor_
920 to specified penColor_.</font></td>
924 <center><a name="quantizeImage"></a> <font size="-1">quantizeImage</font></center>
926 <td><font size="-1">bool measureError_ = false</font></td>
927 <td><font size="-1">Quantize image (reduce number of colors). Set
928 measureError_ to true in order to calculate error attributes.</font></td>
932 <center><a name="raiseImage"></a> <font size="-1">raiseImage</font></center>
934 <td><font size="-1">const <a href="Geometry.html">Geometry</a>
935 &geometry_ = "6x6+0+0",  bool raisedFlag_ =  false</font></td>
936 <td><font size="-1">Raise image (lighten or darken the edges of
937 an image to give a 3-D raised or lowered effect)</font></td>
941 <center><a name="reduceNoiseImage"></a> <font size="-1">reduceNoise-</font> <br />
942 <font size="-1">Image</font></center>
944 <td><font size="-1">void</font></td>
945 <td rowspan="2"><font size="-1">Reduce noise in image using a
946 noise peak elimination filter.</font></td>
949 <td><font size="-1">size_t order_</font></td>
953 <center><a name="rollImage"></a> <font size="-1">rollImage</font></center>
955 <td><font size="-1">int columns_, ssize_t rows_</font></td>
956 <td><font size="-1">Roll image (rolls image vertically and
957 horizontally) by specified number of columnms and rows)</font></td>
961 <center><a name="rotateImage"></a> <font size="-1">rotateImage</font></center>
963 <td><font size="-1">double degrees_</font></td>
964 <td><font size="-1">Rotate image counter-clockwise by specified
965 number of degrees</font></td>
969 <center><a name="sampleImage"></a> <font size="-1">sampleImage</font></center>
971 <td><font size="-1">const <a href="Geometry.html">Geometry</a>
972 &geometry_ </font></td>
973 <td><font size="-1">Resize image by using pixel sampling algorithm</font></td>
977 <center><a name="scaleImage"></a> <font size="-1">scaleImage</font></center>
979 <td><font size="-1">const <a href="Geometry.html">Geometry</a>
980 &geometry_</font></td>
981 <td><font size="-1">Resize image by using simple ratio algorithm</font></td>
985 <center><a name="segmentImage"></a> <font size="-1">segmentImage</font></center>
987 <td><font size="-1">double clusterThreshold_ = 1.0,</font> <br />
988 <font size="-1">double smoothingThreshold_ = 1.5</font></td>
989 <td><font size="-1">Segment (coalesce similar image components)
990 by analyzing the histograms of the color components and identifying
991 units that are homogeneous with the fuzzy c-means technique. Also uses <i>quantizeColorSpace</i>
992 and <i>verbose</i> image attributes. Specify <i>clusterThreshold_</i> ,
993 as the number  of  pixels  each cluster  must exceed
994 the cluster threshold to be considered valid. <i>SmoothingThreshold_</i>
995 eliminates noise in the  second derivative of the histogram. As the
996 value is  increased, you can  expect  a  smoother
997 second derivative.  The default is 1.5.</font></td>
1001 <center><a name="shadeImage"></a> <font size="-1">shadeImage</font></center>
1003 <td><font size="-1">double azimuth_ = 30, double elevation_ = 30,</font> <br />
1004 <font size="-1">bool colorShading_ = false</font></td>
1005 <td><font size="-1">Shade image using distant light source.
1006 Specify <i> azimuth_</i> and <i>elevation_</i> as the 
1007 position  of  the light source. By default, the shading
1008 results as a grayscale image.. Set c<i>olorShading_</i> to <i>true</i> to
1009 shade the red, green, and blue components of the image.</font></td>
1013 <center><a name="sharpenImage"></a> <font size="-1">sharpenImage</font></center>
1015 <td><font size="-1">const double radius_ = 1, const double sigma_
1017 <td><font size="-1">Sharpen pixels in image. The radius_
1018 parameter specifies the radius of the Gaussian, in pixels, not counting
1019 the center pixel.  The sigma_ parameter specifies the standard
1020 deviation of the Laplacian, in pixels.</font></td>
1024 <center><a name="shaveImage"></a> <font size="-1">shaveImage</font></center>
1026 <td><font size="-1">const <a href="Geometry.html">Geometry</a>
1027 &geometry_</font></td>
1028 <td><font size="-1">Shave pixels from image edges.</font></td>
1032 <center><a name="shearImage"></a> <font size="-1">shearImage</font></center>
1034 <td><font size="-1">double xShearAngle_, double yShearAngle_</font></td>
1035 <td><font size="-1">Shear image (create parallelogram by sliding
1036 image by X or Y axis).  Shearing slides one edge of an image along
1037 the X  or  Y axis,  creating  a
1038 parallelogram.  An X direction shear slides an edge along the X
1039 axis, while  a  Y  direction shear  slides  an
1040 edge along the Y axis.  The amount of the shear is controlled by a
1041 shear angle.  For X direction  shears,  x  degrees
1042 is measured relative to the Y axis, and similarly, for Y direction
1043 shears  y  degrees is measured relative to the X axis. Empty
1044 triangles left over from shearing the  image  are filled 
1045 with  the  color  defined as <i>borderColor</i>. </font></td>
1049 <center><a name="solarizeImage"></a> <font size="-1">solarizeImage</font></center>
1051 <td><font size="-1">double factor_</font></td>
1052 <td><font size="-1">Solarize image (similar to effect seen when
1053 exposing a photographic film to light during the development process)</font></td>
1057 <center><a name="spreadImage"></a> <font size="-1">spreadImage</font></center>
1059 <td><font size="-1">size_t amount_ = 3</font></td>
1060 <td><font size="-1">Spread pixels randomly within image by
1061 specified amount</font></td>
1065 <center><a name="steganoImage"></a> <font size="-1">steganoImage</font></center>
1067 <td><font size="-1">const <a href="https://www.imagemagick.org/Magick++/Image++.html">Image</a>
1068 &watermark_</font></td>
1069 <td><font size="-1">Add a digital watermark to the image (based
1070 on second image)</font></td>
1074 <center><a name="stereoImage"></a> <font size="-1">stereoImage</font></center>
1076 <td><font size="-1">const <a href="https://www.imagemagick.org/Magick++/Image++.html">Image</a>
1077 &rightImage_</font></td>
1078 <td><font size="-1">Create an image which appears in stereo when
1079 viewed with red-blue glasses (Red image on left, blue on right)</font></td>
1083 <center><a name="swirlImage"></a> <font size="-1">swirlImage</font></center>
1085 <td><font size="-1">double degrees_</font></td>
1086 <td><font size="-1">Swirl image (image pixels are rotated by
1087 degrees)</font></td>
1091 <center><a name="textureImage"></a> <font size="-1">textureImage</font></center>
1093 <td><font size="-1">const <a href="https://www.imagemagick.org/Magick++/Image++.html">Image</a>
1094 &texture_</font></td>
1095 <td><font size="-1">Layer a texture on image background</font></td>
1099 <center><a name="thresholdImage"></a> <font size="-1">thresholdImage</font></center>
1101 <td><font size="-1">double threshold_</font></td>
1102 <td><font size="-1">Threshold image</font></td>
1106 <center><a name="transformImage"></a> <font size="-1">transformImage</font></center>
1108 <td><font size="-1">const <a href="Geometry.html">Geometry</a>
1109 &imageGeometry_</font></td>
1110 <td rowspan="2"><font size="-1">Transform image based on image
1111 and crop geometries. Crop geometry is optional.</font></td>
1114 <td><font size="-1">const <a href="Geometry.html">Geometry</a>
1115 &imageGeometry_, const <a href="Geometry.html">Geometry</a>
1116 &cropGeometry_ </font></td>
1120 <center><a name="transparentImage"></a> <font size="-1">transparentImage</font></center>
1122 <td><font size="-1">const <a href="Color.html">Color</a>
1123 &color_</font></td>
1124 <td><font size="-1">Add matte image to image, setting pixels
1125 matching color to transparent.</font></td>
1129 <center><a name="trimImage"></a> <font size="-1">trimImage</font></center>
1131 <td><font size="-1">void</font></td>
1132 <td><font size="-1">Trim edges that are the background color from
1133 the image.</font></td>
1137 <center><a name="waveImage"></a> <font size="-1">waveImage</font></center>
1139 <td><font size="-1">double amplitude_ = 25.0, double wavelength_
1141 <td><font size="-1">Alter an image along a sine wave.</font></td>
1145 <center><a name="zoomImage"></a> <font size="-1">zoomImage</font></center>
1147 <td><font size="-1">const <a href="Geometry.html">Geometry</a>
1148 &geometry_</font></td>
1149 <td><font size="-1">Zoom image to specified size.</font></td>
1154 <p>Function objects are available to set attributes on image frames
1155 which are equivalent to methods in the Image object. These function
1156 objects allow setting an option across a range of image frames using f<tt>
1157 or_each()</tt>. </p>
1158 <p>The following code is an example of how the color 'red' may be set
1159 to transparent in a GIF animation: </p>
1161 list<image> images;
1162 readImages( &images, "animation.gif" );
1163 for_each ( images.begin(), images.end(), transparentImage( "red" ) );
1164 writeImages( images.begin(), images.end(), "animation.gif" );
1166 <p>The available function objects for setting image attributes are <br />
1168 <ul><table border="1">
1169 <caption style="font-weight: bold;">Image Attributes</caption> <tbody>
1172 <center><b>Attribute</b></center>
1175 <center><b>Type</b></center>
1178 <center><b>Constructor Signature(s)</b></center>
1181 <center><b>Description</b></center>
1186 <center><a name="adjoinImage"></a> <font size="-1">adjoinImage</font></center>
1188 <td><font size="-1">bool</font></td>
1189 <td><font size="-1">bool flag_</font></td>
1190 <td><font size="-1">Join images into a single multi-image file.</font></td>
1194 <center><a name="antiAlias"></a> <font size="-1">antiAliasImage</font></center>
1196 <td><font size="-1">bool</font></td>
1197 <td><font size="-1">bool flag_</font></td>
1198 <td><font size="-1">Control antialiasing of rendered Postscript
1199 and Postscript or TrueType fonts. Enabled by default.</font></td>
1203 <center><a name="animationDelay"></a> <font size="-1">animation-</font> <br />
1204 <font size="-1">DelayImage</font></center>
1206 <td><font size="-1">size_t (0 to 65535)</font></td>
1207 <td><font size="-1">size_t delay_</font></td>
1208 <td><font size="-1">Time in 1/100ths of a second (0 to 65535)
1209 which must expire before displaying the next image in an animated
1210 sequence. This option is useful for regulating the animation of a
1211 sequence  of GIF images within Netscape.</font></td>
1215 <center><a name="animationIterations"></a> <font size="-1">animation-</font> <br />
1216 <font size="-1">IterationsImage</font></center>
1218 <td><font size="-1">size_t</font></td>
1219 <td><font size="-1">size_t iterations_</font></td>
1220 <td><font size="-1">Number of iterations to loop an animation
1221 (e.g. Netscape loop extension) for.</font></td>
1225 <center><a name="backgroundColor"></a> <font size="-1">background-</font> <br />
1226 <font size="-1">ColorImage</font></center>
1228 <td><font size="-1"><a href="Color.html">Color</a> </font></td>
1229 <td><font size="-1">const <a href="Color.html">Color</a>
1230 &color_</font></td>
1231 <td><font size="-1">Image background color</font></td>
1235 <center><a name="backgroundTexture"></a> <font size="-1">background-</font> <br />
1236 <font size="-1">TextureImage</font></center>
1238 <td><font size="-1">std::string</font></td>
1239 <td><font size="-1">const string &texture_</font></td>
1240 <td><font size="-1">Image to use as background texture.</font></td>
1244 <center><a name="borderColor"></a> <font size="-1">borderColor-</font> <br />
1245 <font size="-1">Image</font></center>
1247 <td><font size="-1"><a href="Color.html">Color</a> </font></td>
1248 <td><font size="-1"> const <a href="Color.html">Color</a>
1249 &color_</font></td>
1250 <td><font size="-1">Image border color</font></td>
1254 <center><a name="boxColor"></a> <font size="-1">boxColorImage</font></center>
1256 <td><font size="-1"><a href="Color.html">Color</a> </font></td>
1257 <td><font size="-1">const <a href="Color.html">Color</a>
1258 &boxColor_</font></td>
1259 <td><font size="-1">Base color that annotation text is rendered
1264 <center><a name="chromaBluePrimary"></a> <font size="-1">chroma-</font> <br />
1265 <font size="-1">BluePrimaryImage</font></center>
1267 <td><font size="-1">double x & y</font></td>
1268 <td><font size="-1">double x_, double y_</font></td>
1269 <td><font size="-1">Chromaticity blue primary point (e.g. x=0.15,
1274 <center><a name="chromaGreenPrimary"></a> <font size="-1">chroma-</font> <br />
1275 <font size="-1">GreenPrimaryImage</font></center>
1277 <td><font size="-1">double x & y</font></td>
1278 <td><font size="-1">double x_, double y_</font></td>
1279 <td><font size="-1">Chromaticity green primary point (e.g. x=0.3,
1284 <center><a name="chromaRedPrimary"></a> <font size="-1">chroma-</font> <br />
1285 <font size="-1">RedPrimaryImage</font></center>
1287 <td><font size="-1">double x & y</font></td>
1288 <td><font size="-1">double x_, double y_</font></td>
1289 <td><font size="-1">Chromaticity red primary point (e.g. x=0.64,
1294 <center><a name="chromaWhitePoint"></a> <font size="-1">chroma-</font> <br />
1295 <font size="-1">WhitePointImage</font></center>
1297 <td><font size="-1">double x & y</font></td>
1298 <td><font size="-1">double x_, double y_</font></td>
1299 <td><font size="-1">Chromaticity white point (e.g. x=0.3127,
1300 y=0.329)</font></td>
1304 <center><a name="colorFuzz"></a> <font size="-1">colorFuzzImage</font></center>
1306 <td><font size="-1">double</font></td>
1307 <td><font size="-1">double fuzz_</font></td>
1308 <td><font size="-1">Colors within this distance are considered
1309 equal. A number of algorithms search for a target  color. By
1310 default the color must be exact. Use this option to match colors that
1311 are close to the target color in RGB space.</font></td>
1315 <center><a name="colorMap"></a> <font size="-1">colorMapImage</font></center>
1317 <td><font size="-1"><a href="Color.html">Color</a> </font></td>
1318 <td><font size="-1">size_t index_, const <a
1319 href="Color.html">Color</a> &color_</font></td>
1320 <td><font size="-1">Color at color-pallet index.</font></td>
1323 <td><a name="colorSpaceImage"></a> <font size="-1">colorSpaceImage</font></td>
1324 <td><font size="-1"><a href="Enumerations.html#ColorspaceType">ColorspaceType</a> </font></td>
1325 <td><font size="-1"><a href="Enumerations.html#ColorspaceType">ColorspaceType</a>
1326 colorSpace_</font></td>
1327 <td><font size="-1">The colorspace (e.g. CMYK) used to represent
1328 the image pixel colors. Image pixels are always stored as RGB(A) except
1329 for the case of CMY(K).</font></td>
1333 <center><a name="composeImage"></a> <font size="-1">composeImage</font></center>
1335 <td><font size="-1"><a href="Enumerations.html#CompositeOperator">CompositeOperator</a> </font></td>
1336 <td><font size="-1"><a href="Enumerations.html#CompositeOperator">CompositeOperator</a>
1337 compose_</font></td>
1338 <td><font size="-1">Composition operator to be used when
1339 composition is implicitly used (such as for image flattening).</font></td>
1343 <center><a name="compressType"></a> <font size="-1">compressType-</font> <br />
1344 <font size="-1">Image</font></center>
1346 <td><font size="-1"><a href="Enumerations.html#CompressionType">CompressionType</a> </font></td>
1347 <td><font size="-1"><a href="Enumerations.html#CompressionType">CompressionType</a>
1348 compressType_</font></td>
1349 <td><font size="-1">Image compresion type. The default is the
1350 compression type of the specified image file.</font></td>
1354 <center><a name="density"></a> <font size="-1">densityImage</font></center>
1356 <td><font size="-1"><a href="Geometry.html">Geometry</a>  
1357 (default 72x72)</font></td>
1358 <td><font size="-1">const <a href="Geometry.html">Geometry</a>
1359 &density_</font></td>
1360 <td><font size="-1">Vertical and horizontal resolution in pixels
1361 of the image. This option specifies an image density when decoding a
1362 Postscript or Portable Document page. Often used with <i>psPageSize</i>.</font></td>
1366 <center><a name="depth"></a> <font size="-1">depthImage</font></center>
1368 <td><font size="-1">size_t (8 or 16)</font></td>
1369 <td><font size="-1">size_t depth_</font></td>
1370 <td><font size="-1">Image depth. Used to specify the bit depth
1371 when reading or writing  raw images or thwn the output format
1372 supports multiple depths. Defaults to the quantum depth that
1373 ImageMagick is compiled with.</font></td>
1377 <center><a name="endianImage"></a> <font size="-1">endianImage</font></center>
1379 <td><font size="-1"><a href="Enumerations.html#EndianType">EndianType</a> </font></td>
1380 <td><font size="-1"><a href="Enumerations.html#EndianType">EndianType</a>
1382 <td><font size="-1">Specify (or obtain) endian option for formats
1383 which support it.</font></td>
1387 <center><a name="fileName"></a> <font size="-1">fileNameImage</font></center>
1389 <td><font size="-1">std::string</font></td>
1390 <td><font size="-1">const std::string &fileName_</font></td>
1391 <td><font size="-1">Image file name.</font></td>
1395 <center><a name="fillColorImage"></a> <font size="-1">fillColorImage</font></center>
1397 <td><font size="-1">Color</font></td>
1398 <td><font size="-1">const Color &fillColor_</font></td>
1399 <td><font size="-1">Color to use when filling drawn objects</font></td>
1403 <center><a name="filterType"></a> <font size="-1">filterTypeImage</font></center>
1405 <td><font size="-1"><a href="Enumerations.html#FilterTypes">FilterTypes</a> </font></td>
1406 <td><font size="-1"><a href="Enumerations.html#FilterTypes">FilterTypes</a>
1407 filterType_</font></td>
1408 <td><font size="-1">Filter to use when resizing image. The
1409 reduction filter employed has a sigificant effect on the time required
1410 to resize an image and the resulting quality. The default filter is <i>Lanczos</i>
1411 which has been shown to produce good results when reducing images.</font></td>
1415 <center><a name="font"></a> <font size="-1">fontImage</font></center>
1417 <td><font size="-1">std::string</font></td>
1418 <td><font size="-1">const std::string &font_</font></td>
1419 <td><font size="-1">Text rendering font. If the font is a fully
1420 qualified X server font name, the font is obtained from an X 
1421 server. To use a TrueType font, precede the TrueType filename with an @.
1422 Otherwise, specify  a  Postscript font name (e.g.
1423 "helvetica").</font></td>
1427 <center><a name="fontPointsize"></a> <font size="-1">fontPointsize-</font> <br />
1428 <font size="-1">Image</font></center>
1430 <td><font size="-1">size_t</font></td>
1431 <td><font size="-1">size_t pointSize_</font></td>
1432 <td><font size="-1">Text rendering font point size</font></td>
1436 <center><a name="gifDisposeMethod"></a> <font size="-1">gifDispose-</font> <br />
1437 <font size="-1">MethodImage</font></center>
1439 <td><font size="-1">size_t</font> <br />
1440 <font size="-1">{ 0 = Disposal not specified,</font> <br />
1441 <font size="-1">1 = Do not dispose of graphic,</font> <br />
1442 <font size="-1">3 = Overwrite graphic with background color,</font> <br />
1443 <font size="-1">4 = Overwrite graphic with previous graphic. }</font></td>
1444 <td><font size="-1">size_t disposeMethod_</font></td>
1445 <td><font size="-1">layer disposal method. This option is used to
1446 control how successive frames are rendered (how the preceding frame is
1447 disposed of) when creating a GIF animation.</font></td>
1451 <center><a name="interlaceType"></a> <font size="-1">interlace-</font> <br />
1452 <font size="-1">TypeImage</font></center>
1454 <td><font size="-1"><a href="Enumerations.html#InterlaceType">InterlaceType</a> </font></td>
1455 <td><font size="-1"><a href="Enumerations.html#InterlaceType">InterlaceType</a>
1456 interlace_</font></td>
1457 <td><font size="-1">The type of interlacing scheme (default <i>NoInterlace</i>
1458 ). This option is used to specify the type of  interlacing
1459 scheme  for  raw  image formats such as RGB or YUV. <i>NoInterlace</i>
1460 means do not  interlace, <i>LineInterlace</i> uses scanline
1461 interlacing, and <i>PlaneInterlace</i> uses plane interlacing. <i>
1462 PartitionInterlace</i> is like <i>PlaneInterlace</i> except the 
1463 different planes  are saved  to individual files (e.g. 
1464 image.R, image.G, and image.B). Use <i>LineInterlace</i> or <i>PlaneInterlace</i>
1465 to create an interlaced GIF or progressive JPEG image.</font></td>
1469 <center><a name="isValidImage"></a> <font size="-1">isValidImage</font></center>
1471 <td><font size="-1">bool</font></td>
1472 <td><font size="-1">bool isValid_</font></td>
1473 <td><font size="-1">Set image validity. Valid images become empty
1474 (inValid) if argument is false.</font></td>
1478 <center><a name="label"></a> <font size="-1">labelImage</font></center>
1480 <td><font size="-1">std::string</font></td>
1481 <td><font size="-1">const std::string &label_</font></td>
1482 <td><font size="-1">Image label</font></td>
1486 <center><a name="lineWidth"></a> <font size="-1">lineWidthImage</font></center>
1488 <td><font size="-1">double</font></td>
1489 <td><font size="-1">double lineWidth_</font></td>
1490 <td><font size="-1">Line width for drawing lines, circles,
1491 ellipses, etc. See <a href="Drawable.html">Drawable</a> .</font></td>
1495 <center><a name="magick"></a> <font size="-1">magickImage</font></center>
1497 <td><font size="-1">std::string</font></td>
1498 <td><font size="-1"> const std::string &magick_</font></td>
1499 <td><font size="-1">Get image format (e.g. "GIF")</font></td>
1503 <center><a name="matte"></a> <font size="-1">matteImage</font></center>
1505 <td><font size="-1">bool</font></td>
1506 <td><font size="-1">bool matteFlag_</font></td>
1507 <td><font size="-1">True if the image has transparency. If set
1508 True, store matte channel if  the image has one otherwise create
1509 an opaque one.</font></td>
1513 <center><a name="matteColor"></a> <font size="-1">matteColorImage</font></center>
1515 <td><font size="-1"><a href="Color.html">Color</a> </font></td>
1516 <td><font size="-1">const <a href="Color.html">Color</a>
1517 &matteColor_</font></td>
1518 <td><font size="-1">Image matte (frame) color</font></td>
1522 <center><a name="monochrome"></a> <font size="-1">monochrome-</font> <br />
1523 <font size="-1">Image</font></center>
1525 <td><font size="-1">bool</font></td>
1526 <td><font size="-1">bool flag_</font></td>
1527 <td><font size="-1">Transform the image to black and white</font></td>
1531 <center><a name="pageImage"></a> <font size="-1">pageImage</font></center>
1533 <td><font size="-1"><a href="Geometry.html#PostscriptPageSize">Geometry</a> </font></td>
1534 <td><font size="-1">const <a
1535 href="Geometry.html#PostscriptPageSize">Geometry</a> &pageSize_</font></td>
1536 <td><font size="-1">Preferred size and location of an image
1538 <p><font size="-1">Use this option to specify the dimensions and
1539 position of the Postscript page in dots per inch or a TEXT page in
1540 pixels. This option is typically used in concert with <i><a
1541 href="STL.html#density">density</a> </i>.</font> </p>
1542 <p><font size="-1">Page may also be used to position a GIF image
1543 (such as for a scene in an animation)</font></p>
1548 <center><a name="penColor"></a> <font size="-1">penColorImage</font></center>
1550 <td><font size="-1"><a href="Color.html">Color</a> </font></td>
1551 <td><font size="-1">const <a href="Color.html">Color</a>
1552 &penColor_</font></td>
1553 <td><font size="-1">Pen color to use when annotating on or
1554 drawing on image.</font></td>
1558 <center><a name="penTexture"></a> <font size="-1">penTextureImage</font></center>
1560 <td><font size="-1"><a href="https://www.imagemagick.org/Magick++/Image++.html">Image</a> </font></td>
1561 <td><font size="-1">const Image & penTexture_</font></td>
1562 <td><font size="-1">Texture image to paint with (similar to
1563 penColor).</font></td>
1567 <center><a name="pixelColor"></a> <font size="-1">pixelColorImage</font></center>
1569 <td><font size="-1"><a href="Color.html">Color</a> </font></td>
1570 <td><font size="-1">size_t x_, size_t y_, const <a
1571 href="Color.html"> Color</a> &color_</font></td>
1572 <td><font size="-1">Get/set pixel color at location x & y.</font></td>
1576 <center><a name="psPageSize"></a> <font size="-1">psPageSizeImage</font></center>
1578 <td><font size="-1"><a href="Geometry.html#PostscriptPageSize">Geometry</a> </font></td>
1579 <td><font size="-1">const <a
1580 href="Geometry.html#PostscriptPageSize">Geometry</a> &pageSize_</font></td>
1581 <td><font size="-1">Postscript page size. Use this  option
1582 to specify the dimensions  of the Postscript page in dots per inch
1583 or a TEXT page in pixels. This option is typically used in concert with <i>density</i>.</font></td>
1587 <center><a name="quality"></a> <font size="-1">qualityImage</font></center>
1589 <td><font size="-1">size_t (0 to 100)</font></td>
1590 <td><font size="-1">size_t quality_</font></td>
1591 <td><font size="-1">JPEG/MIFF/PNG compression level (default 75).</font></td>
1595 <center><a name="quantizeColors"></a> <font size="-1">quantize-</font> <br />
1596 <font size="-1">ColorsImage</font></center>
1598 <td><font size="-1">size_t</font></td>
1599 <td><font size="-1">size_t colors_</font></td>
1600 <td><font size="-1">Preferred number of colors in the image. The
1601 actual number of colors in the image may be less than your request, but
1602 never more. Images with less unique colors than specified with this
1603 option will have any duplicate or unused colors removed.</font></td>
1607 <center><a name="quantizeColorSpace"></a> <font size="-1">quantize-</font> <br />
1608 <font size="-1">ColorSpaceImage</font></center>
1610 <td><font size="-1"><a href="Enumerations.html#ColorspaceType">ColorspaceType</a> </font></td>
1611 <td><font size="-1"><a href="Enumerations.html#ColorspaceType">ColorspaceType</a>
1612 colorSpace_</font></td>
1613 <td><font size="-1">Colorspace to quantize colors in (default
1614 RGB). Empirical evidence suggests that distances in color spaces such
1615 as YUV or YIQ correspond to perceptual color differences more closely
1616 than do distances in RGB space. These color spaces may give better
1617 results when color reducing an image.</font></td>
1621 <center><a name="quantizeDither"></a> <font size="-1">quantize-</font> <br />
1622 <font size="-1">DitherImage</font></center>
1624 <td><font size="-1">bool</font></td>
1625 <td><font size="-1">bool flag_</font></td>
1626 <td><font size="-1">Apply Floyd/Steinberg error diffusion to the
1627 image. The basic strategy of dithering is to  trade  intensity
1628 resolution  for  spatial  resolution  by 
1629 averaging the intensities  of  several 
1630 neighboring  pixels. Images which  suffer  from 
1631 severe  contouring  when  reducing colors can be improved
1632 with this option. The quantizeColors or monochrome option must be set
1633 for this option to take effect.</font></td>
1637 <center><a name="quantizeTreeDepth"></a> <font size="-1">quantize-</font> <br />
1638 <font size="-1">TreeDepthImage</font></center>
1640 <td><font size="-1">size_t (0 to 8)</font></td>
1641 <td><font size="-1">size_t treeDepth_</font></td>
1642 <td><font size="-1">Depth of the quantization color
1643 classification tree. Values of 0 or 1 allow selection of the optimal
1644 tree depth for the color reduction algorithm. Values between 2 and 8 may
1645 be used to manually adjust the tree depth.</font></td>
1649 <center><a name="renderingIntent"></a> <font size="-1">rendering-</font> <br />
1650 <font size="-1">IntentImage</font></center>
1652 <td><font size="-1"><a href="Enumerations.html#RenderingIntent">RenderingIntent</a> </font></td>
1653 <td><font size="-1"><a href="Enumerations.html#RenderingIntent">RenderingIntent</a>
1655 <td><font size="-1">The type of rendering intent</font></td>
1659 <center><a name="resolutionUnits"></a> <font size="-1">resolution-</font> <br />
1660 <font size="-1">UnitsImage</font></center>
1662 <td><font size="-1"><a href="Enumerations.html#ResolutionType">ResolutionType</a> </font></td>
1663 <td><font size="-1"><a href="Enumerations.html#ResolutionType">ResolutionType</a>
1665 <td><font size="-1">Units of image resolution</font></td>
1669 <center><a name="scene"></a> <font size="-1">sceneImage</font></center>
1671 <td><font size="-1">size_t</font></td>
1672 <td><font size="-1">size_t scene_</font></td>
1673 <td><font size="-1">Image scene number</font></td>
1677 <center><a name="size"></a> <font size="-1">sizeImage</font></center>
1679 <td><font size="-1"><a href="Geometry.html">Geometry</a> </font></td>
1680 <td><font size="-1">const <a href="Geometry.html">Geometry</a>
1681 &geometry_</font></td>
1682 <td><font size="-1">Width and height of a raw image (an image
1683 which does not support width and height information).  Size may
1684 also be used to affect the image size read from a multi-resolution
1685 format (e.g. Photo CD, JBIG, or JPEG.</font></td>
1689 <center><a name="stripImage"></a> <font size="-1">stripImage</font></center>
1691 <td><font size="-1">void</font></td>
1692 <td><font size="-1">strips an image of all profiles and comments.</font></td>
1696 <center><a name="strokeColorImage"></a> <font size="-1">strokeColorImage</font></center>
1698 <td><font size="-1"><a href="Color.html">Color</a> </font></td>
1699 <td><font size="-1">const <a href="Color.html">Color</a>
1700 &strokeColor_</font></td>
1701 <td><font size="-1">Color to use when drawing object outlines</font></td>
1705 <center><a name="subImage"></a> <font size="-1">subImageImage</font></center>
1707 <td><font size="-1">size_t</font></td>
1708 <td><font size="-1">size_t subImage_</font></td>
1709 <td><font size="-1">Subimage of an image sequence</font></td>
1713 <center><a name="subRange"></a> <font size="-1">subRangeImage</font></center>
1715 <td><font size="-1">size_t</font></td>
1716 <td><font size="-1">size_t subRange_</font></td>
1717 <td><font size="-1">Number of images relative to the base image</font></td>
1721 <center><a name="tileName"></a> <font size="-1">tileNameImage</font></center>
1723 <td><font size="-1">std::string</font></td>
1724 <td><font size="-1">const std::string &tileName_</font></td>
1725 <td><font size="-1">Tile name</font></td>
1729 <center><a name="typeImage"></a> <font size="-1">typeImage</font></center>
1731 <td><font size="-1"><a href="Enumerations.html#ImageType">ImageType</a> </font></td>
1732 <td><font size="-1"><a href="Enumerations.html#ImageType">ImageType</a>
1734 <td><font size="-1">Image storage type.</font></td>
1738 <center><a name="verbose"></a> <font size="-1">verboseImage</font></center>
1740 <td><font size="-1">bool</font></td>
1741 <td><font size="-1">bool verboseFlag_</font></td>
1742 <td><font size="-1">Print detailed information about the image</font></td>
1746 <center><a name="view"></a> <font size="-1">viewImage</font></center>
1748 <td><font size="-1">std::string</font></td>
1749 <td><font size="-1">const std::string &view_</font></td>
1750 <td><font size="-1">FlashPix viewing parameters.</font></td>
1754 <center><a name="x11Display"></a> <font size="-1">x11DisplayImage</font></center>
1756 <td><font size="-1">std::string (e.g. "hostname:0.0")</font></td>
1757 <td><font size="-1">const std::string &display_</font></td>
1758 <td><font size="-1">X11 display to display to, obtain fonts from,
1759 or to capture image from</font></td>
1766 <h3> Query Image Format Support</h3>
1768 <p>Magick++ provides the <a name="coderInfoList"></a> <i>coderInfoList()</i>
1769 function to support obtaining information about the image formats
1770 supported by ImageMagick. Support for image formats in ImageMagick
1771 is provided by modules known as "coders". A user-provided container is
1772 updated based on a boolean truth-table match. The truth-table supports
1773 matching based on whether ImageMagick can read the format, write the
1774 format, or supports multiple frames for the format. A wildcard specifier
1775 is supported for any "don't care" field. The data obtained via
1776 coderInfoList() may be useful for preparing GUI dialog boxes or for
1777 deciding which output format to write based on support within the
1778 ImageMagick build.</p>
1779 <p>The definition of coderInfoList is: </p>
1786 AnyMatch, // match any coder
1787 TrueMatch, // match coder if true
1788 FalseMatch // match coder if false
1791 [ remaining CoderInfo methods ]
1795 template <class Container >
1796 void coderInfoList( Container *container_,
1797 CoderInfo::MatchType isReadable_ = CoderInfo::AnyMatch,
1798 CoderInfo::MatchType isWritable_ = CoderInfo::AnyMatch,
1799 CoderInfo::MatchType isMultiFrame_ = CoderInfo::AnyMatch
1802 <p>The following example shows how to retrieve a list of all of the
1803 coders which support reading images and print the coder attributes (all
1804 listed formats will be readable): </p>
1806 list<CoderInfo> coderList;
1807 coderInfoList( &coderList, // Reference to output list
1808 CoderInfo::TrueMatch, // Match readable formats
1809 CoderInfo::AnyMatch, // Don't care about writable formats
1810 CoderInfo::AnyMatch); // Don't care about multi-frame support
1811 list<CoderInfo>::iterator entry = coderList.begin();
1812 while( entry != coderList.end() )
1814 cout << entry->name() << ": (" << entry->description() << ") : ";
1815 cout << "Readable = ";
1816 if ( entry->isReadable() )
1817 cout << "true";
1819 cout << "false";
1821 cout << "Writable = ";
1822 if ( entry->isWritable() )
1823 cout << "true";
1825 cout << "false";
1827 cout << "Multiframe = ";
1828 if ( entry->isMultiframe() )
1829 cout << "true";
1831 cout << "false";
1836 <tt><font color="#000066">   }</font></tt> <!-- p -->
1837 <h3 style="text-align: center;">Obtaining A Color Histogram  </h3>
1838 <p>Magick++ provides the <a name="colorHistogram"></a><span
1839 style="font-weight: bold;">colorHistogram</span> template function to
1840 retrieve a color histogram from an image. A color histogram provides a
1841 count of how many times each color occurs in the image. The histogram is
1842 written into a user-provided container, which (for example) could be a <span
1843 style="font-style: italic;"><vector></span> or a <span
1844 style="font-style: italic;"><map></span>.  When a
1845 <map> is used, the <span style="font-style: italic;">Color</span>
1846 is used as the key so that quick lookups of usage counts for colors may
1847 be performed. Writing into a <span style="font-style: italic;"><map></span>
1848 may be slower than writing into a <span style="font-style: italic;"><vector></span>
1849 since the <span style="font-style: italic;"><map></span> sorts the
1850 entries (by color intensity) and checks for uniqueness. Each histogram
1851 entry is contained in type <span style="font-style: italic;">std::pair<Magick::Color,unsigned
1852 long></span><span style="font-style: italic;"> </span>with the first
1853 member of the pair being a <span style="font-style: italic;">Color,</span>
1854 and the second member of the pair being an '<span
1855 style="font-style: italic;">unsigned long</span>'. Use the <span
1856 style="font-style: italic;"><pair></span> "<span
1857 style="font-style: italic;">first</span>" member to access the Color
1858 and the "<span style="font-style: italic;">second</span>" member to
1859 access the number of times the color occurs in the image.</p>
1860 <p>The template function declaration is as follows:<br />
1863 template <class Container >
1864 void colorHistogram( Container *histogram_, const Image image)
1866 <p>The following examples illustrate using both a <map> and a
1867 <vector> to retrieve the color histogram, and print out a
1868 formatted summary.<br />
1870 Using <map>:<br />
1871     <br />
1873 Image image("image.miff");
1874 map<Color,unsigned long> histogram;
1875 colorHistogram( &histogram, image );
1876 std::map<Color,unsigned long>::const_iterator p=histogram.begin();
1877 while (p != histogram.end())
1879 cout << setw(10) << (int)p->second << ": ("
1880 << setw(quantum_width) << (int)p->first.redQuantum() << ","
1881 << setw(quantum_width) << (int)p->first.greenQuantum() << ","
1882 << setw(quantum_width) << (int)p->first.blueQuantum() << ")"
1888 Using <vector>:<br />
1889     <br />
1891 Image image("image.miff");
1892 std::vector<std::pair<Color,unsigned long> > histogram;
1893 colorHistogram( &histogram, image );
1894 std::vector<std::pair<Color,unsigned long> >::const_iterator p=histogram.begin();
1895 while (p != histogram.end())
1897 cout << setw(10) << (int)p->second << ": ("
1898 << setw(quantum_width) << (int)p->first.redQuantum() << ","
1899 << setw(quantum_width) << (int)p->first.greenQuantum() << ","
1900 << setw(quantum_width) << (int)p->first.blueQuantum() << ")"