\section{Magick::Image Class}
\scriptsize{
\begin{verbatim}

Quick Contents

   * BLOBs
   * Constructors
   * Image Manipulation Methods
   * Image Attributes
   * Raw Image Pixel Access

  ------------------------------------------------------------------------
Image is the primary object in Magick++ and represents a single image frame
(see design). The STL interface must be used to operate on image sequences
or images (e.g. of format GIF, TIFF, MIFF, Postscript, & MNG) which are
comprized of multiple image frames. Individual frames of a multi-frame image
may be requested by adding array-style notation to the end of the file name
(e.g. "animation.gif[3]" retrieves the fourth frame of a GIF animation.
Various image manipulation operations may be applied to the image.
Attributes may be set on the image to influence the operation of the
manipulation operations. The Pixels class provides low-level access to image
pixels. As a convenience, including <Magick++.h> is sufficient in order to
use the complete Magick++ API. The Magick++ API is enclosed within the
Magick namespace so you must either add the prefix "Magick::" to each
class/enumeration name or add the statement "using namespace Magick;" after
including the Magick++.h header.

The preferred way to allocate Image objects is via automatic allocation (on
the stack). There is no concern that allocating Image objects on the stack
will excessively enlarge the stack since Magick++ allocates all large data
objects (such as the actual image data) from the heap. Use of automatic
allocation is preferred over explicit allocation (via new) since it is much
less error prone and allows use of C++ scoping rules to avoid memory leaks.
Use of automatic allocation allows Magick++ objects to be assigned and
copied just like the C++ intrinsic data types (e.g. 'int'), leading to clear
and easy to read code. Use of automatic allocation leads to naturally
exception-safe code since if an exception is thrown, the object is
automatically deallocated once the stack unwinds past the scope of the
allocation (not the case for objects allocated via new).

Image is very easy to use. For example, here is a the source to a program
which reads an image, crops it, and writes it to a new file (the exception
handling is optional but strongly recommended):

     #include <Magick++.h>
     #include <iostream>
     using namespace std;
     using namespace Magick;
     int main(int argc,char **argv)
     {
       try {
         // Create an image object and read an image
         Image image( "girl.gif" );

         // Crop the image to specified size
         // (Geometry implicitly initialized by char *)
         image.crop("100x100+100+100" );

         // Write the image to a file
         image.write( "x.gif" );
       }
       catch( Exception &error_ )
         {
           cout << "Caught exception: " << error_.what() << endl;
           return 1;
         }
       return 0;
     }

The following is the source to a program which illustrates the use of
Magick++'s efficient reference-counted assignment and copy-constructor
operations which minimize use of memory and eliminate unncessary copy
operations (allowing Image objects to be efficiently assigned, and copied
into containers).  The program accomplishes the following:

  1. Read master image.
  2. Assign master image to second image.
  3. Zoom second image to the size 640x480.
  4. Assign master image to a third image.
  5. Zoom third image to the size 800x600.
  6. Write the second image to a file.
  7. Write the third image to a file.

     #include <Magick++.h>
     #include <iostream>
     using namespace std;
     using namespace Magick;
     int main(int argc,char **argv)
     {
         Image master("horse.jpg");
         Image second = master;
         second.zoom("640x480");
         Image third = master;
         third.zoom("800x600");
         second.write("horse640x480.jpg");
         third.write("horse800x600.jpg");
         return 0;
     }

During the entire operation, a maximum of three images exist in memory and
the image data is never copied.

The following is the source for another simple program which creates a 100
by 100 pixel white image with a red pixel in the center and writes it to a
file:

     #include <Magick++.h>
     using namespace std;
     using namespace Magick;
     int main(int argc,char **argv)
     {
         Image image( "100x100", "white" );
         image.pixelColor( 49, 49, "red" );
         image.write( "red_pixel.png" );
         return 0;
     }

If you wanted to change the color image to grayscale, you could add the
lines:

    image.quantizeColorSpace( GRAYColorspace );
    image.colors( 256 );
    image.quantize( );

or, more simply:

    image.type( GrayscaleType );

prior to writing the image.

BLOBs

While encoded images (e.g. JPEG) are most often written-to and read-from a
disk file, encoded images may also reside in memory. Encoded images in
memory are known as BLOBs (Binary Large OBjects) and may be represented
using the Blob class. The encoded image may be initially placed in memory by
reading it directly from a file, reading the image from a database,
memory-mapped from a disk file, or could be written to memory by Magick++.
Once the encoded image has been placed within a Blob, it may be read into a
Magick++ Image via a constructor or read(). Likewise, a Magick++ image may
be written to a Blob via write().

An example of using Image to write to a Blob follows:


     #include <Magick++.h>
     using namespace std;
     using namespace Magick;
     int main(int argc,char **argv)
     {
         // Read GIF file from disk
         Image image( "giraffe.gif" );

         // Write to BLOB in JPEG format
         Blob blob;
         image.magick( "JPEG" ) // Set JPEG output format
         image.write( &blob );

         [ Use BLOB data (in JPEG format) here ]

         return 0;
     }

likewise, to read an image from a Blob, you could use one of the following
examples:

[ Entry condition for the following examples is that data is pointer to
encoded image data and length represents the size of the data ]

     Blob blob( data, length );
     Image image( blob );

or

     Blob blob( data, length );
     Image image;
     image.read( blob);

some images do not contain their size or format so the size and format must
be specified in advance:

     Blob blob( data, length );
     Image image;
     image.size( "640x480")
     image.magick( "RGBA" );
     image.read( blob);

Constructors

Image may be constructed in a number of ways. It may be constructed from a
file, a URL, or an encoded image (e.g. JPEG) contained in an in-memory BLOB.
The available Image constructors are shown in the following table:


                             Image Constructors

 Signature                 Description

                           Construct Image by reading from file or URL
 const std::string         specified by imageSpec_. Use array notation
 &imageSpec_               (e.g. filename[9]) to select a specific scene
                           from a multi-frame image.

 const Geometry &size_,    Construct a blank image canvas of specified size
 const Color &color_       and color

                           Construct Image by reading from encoded image
                           data contained in an in-memory BLOB. Depending
                           on the constructor arguments, the Blob size,
                           depth, magick (format) may also be specified.
                           Some image formats require that size be
                           specified. The default ImageMagick uses for
 const Blob &blob_         depth depends on the compiled-in Quantum size (8
                           or 16).  If ImageMagick's Quantum size does not
                           match that of the image, the depth may need to
                           be specified. ImageMagick can usually
                           automatically detect the image's format. When a
                           format can't be automatically detected, the
                           format (magick) must be specified.

                           const Blob &blob_, const Geometry &size_


                           const Blob &blob_, const Geometry &size,
                           unsigned int depth


                           const Blob &blob_, const Geometry &size,
                           unsigned int depth_, const string &magick_


                           const Blob &blob_, const Geometry &size, const
                           string &magick_

                           Construct a new Image based on an array of image
                           pixels. The pixel data must be in scanline order
                           top-to-bottom. The data can be character, short
                           int, integer, float, or double. Float and double
                           require the pixels to be normalized [0..1]. The
                           other types are [0..MaxRGB].  For example, to
                           create a 640x480 image from unsigned
                           red-green-blue character data, use

                              Image image( 640, 480, "RGB", 0, pixels );

                           The parameters are as follows:

                           width_  Width in pixels of the image.

 const unsigned int        height_ Height in pixels of the image.
 width_,
 const unsigned int
 height_,                          This character string can be any
 std::string map_,                 combination or order of R = red, G =
 const StorageType type_,  map_    green, B = blue, A = alpha, C = cyan, Y
 const void *pixels_               = yellow M = magenta, and K = black. The
                                   ordering reflects the order of the
                                   pixels in the supplied pixel array.

                                   Pixel storage type (CharPixel,
                           type_   ShortPixel, IntegerPixel, FloatPixel, or
                                   DoublePixel)

                                   This array of values contain the pixel
                                   components as defined by the map_ and
                           pixels_ type_ parameters. The length of the
                                   arrays must equal the area specified by
                                   the width_ and height_ values and type_
                                   parameters.




Image Manipulation Methods

Image supports access to all the single-image (versus image-list)
manipulation operations provided by the ImageMagick library. If you must
process a multi-image file (such as an animation), the STL interface, which
provides a multi-image abstraction on top of Image, must be used.

The operations supported by Image are shown in the following table:

                       Image Image Manipulation Methods

      Method         Signature(s)                   Description


 addNoise        NoiseType noiseType_ Add noise to image with specified noise
                                      type.

                 const std::string
 annotate        &text_, const        Annotate using specified text, and
                 Geometry &location_  placement location

                 string text_, const  Annotate using specified text, bounding
                 Geometry             area, and placement gravity. If
                 &boundingArea_,      boundingArea_ is invalid, then bounding
                 GravityType gravity_ area is entire image.

                 const std::string
                 &text_, const        Annotate with text using specified
                 Geometry             text, bounding area, placement gravity,
                 &boundingArea_,      and rotation. If boundingArea_ is
                 GravityType          invalid, then bounding area is entire
                 gravity_, double     image.
                 degrees_,

                 const std::string
                 &text_, GravityType  Annotate with text (bounding area is
                 gravity_             entire image) and placement gravity.

                                      Blur image. The radius_ parameter
                 const double radius_ specifies the radius of the Gaussian,
 blur            = 1, const double    in pixels, not counting the center
                 sigma_ = 0.5         pixel.  The sigma_ parameter specifies
                                      the standard deviation of the
                                      Laplacian, in pixels.

                 const Geometry       Border image (add border to image).
 border          &geometry_ =         The color of the border is specified by
                 "6x6+0+0"            the borderColor attribute.

                                      Extract channel from image. Use this
                                      option to extract a particular channel
 channel         ChannelType layer_   from  the image.  MatteChannel  for
                                      example, is useful for extracting the
                                      opacity values from an image.

                                      Charcoal effect image (looks like
                                      charcoal sketch). The radius_ parameter
                 const double radius_ specifies the radius of the Gaussian,
 charcoal        = 1, const double    in pixels, not counting the center
                 sigma_ = 0.5         pixel.  The sigma_ parameter specifies
                                      the standard deviation of the
                                      Laplacian, in pixels.


 chop            const Geometry       Chop image (remove vertical or
                 &geometry_           horizontal subregion of image)

                 const unsigned int
                 opacityRed_, const
                 unsigned int         Colorize image with pen color, using
 colorize        opacityGreen_, const specified percent opacity for red,
                 unsigned int         green, and blue quantums.
                 opacityBlue_, const
                 Color &penColor_

                 const unsigned int
                 opacity_, const      Colorize image with pen color, using
                 Color &penColor_     specified percent opacity.

                                      Comment image (add comment string to
                                      image).  By default, each image is
                                      commented with its file name. Use
                                      this  method to  assign a specific
 comment         const string         comment to the image.  Optionally you
                 &comment_
                                      can include the image filename, type,
                                      width, height, or other  image
                                      attributes by embedding special format
                                      characters.

                 const Image
                 &compositeImage_,
                 int xOffset_, int    Compose an image onto the current image
 composite       yOffset_,            at offset specified by xOffset_,
                 CompositeOperator    yOffset_ using the composition
                 compose_ =           algorithm specified by compose_.
                 InCompositeOp

                 const Image
                 &compositeImage_,
                 const Geometry       Compose an image onto the current image
                 &offset_,            at offset specified by offset_ using
                 CompositeOperator    the composition algorithm specified by
                 compose_ =           compose_.
                 InCompositeOp

                 const Image
                 &compositeImage_,
                 GravityType          Compose an image onto the current image
                 gravity_,            with placement specified by gravity_
                 CompositeOperator    using the composition algorithm
                 compose_ =           specified by compose_.
                 InCompositeOp


 contrast        unsigned int         Contrast image (enhance intensity
                 sharpen_             differences in image)

                                      Convolve image.  Applies a
                                      user-specfied convolution to the image.
                 unsigned int order_, The order_ parameter represents the
 convolve        const double         number of columns and rows in the
                 *kernel_             filter kernel, and kernel_ is a
                                      two-dimensional array of doubles
                                      representing the convolution kernel to
                                      apply.


 crop            const Geometry       Crop image (subregion of original
                 &geometry_           image)

 cycleColormap   int amount_          Cycle image colormap

 despeckle       void                 Despeckle image (reduce speckle noise)

                                      Display image on screen.
                                      Caution: if an image format is is not
                                      compatable with the display visual
 display         void                 (e.g. JPEG on a colormapped display)
                                      then the original image will be
                                      altered. Use a copy of the original if
                                      this is a problem.


 draw            const Drawable       Draw shape or text on image.
                 &drawable_

                                      Draw shapes or text on image using a
                 const                set of Drawable objects contained in an
                 std::list<Drawable>  STL list. Use of this method improves
                 &drawable_           drawing performance and allows batching
                                      draw objects together in a list for
                                      repeated use.

                                      Edge image (hilight edges in image).
 edge            unsigned int radius_ The radius is the radius of the pixel
                 = 0.0                neighborhood.. Specify a radius of zero
                                      for automatic radius selection.

                                      Emboss image (hilight edges with 3D
                                      effect). The radius_ parameter
                 const double radius_ specifies the radius of the Gaussian,
 emboss          = 1, const double    in pixels, not counting the center
                 sigma_ = 0.5         pixel.  The sigma_ parameter specifies
                                      the standard deviation of the
                                      Laplacian, in pixels.

 enhance         void                 Enhance image (minimize noise)

 equalize        void                 Equalize image (histogram equalization)


 erase           void                 Set all image pixels to the current
                                      background color.


 flip            void                 Flip image (reflect each scanline in
                                      the vertical direction)


                 unsigned int x_,     Flood-fill color across pixels that
 floodFill-      unsigned int y_,     match the color of the target pixel and
 Color           const Color          are neighbors of the target pixel. Uses
                 &fillColor_          current fuzz setting when determining
                                      color match.

                 const Geometry
                 &point_, const Color
                 &fillColor_

                 unsigned int x_,     Flood-fill color across pixels starting
                 unsigned int y_,     at target-pixel and stopping at pixels
                 const Color          matching specified border color. Uses
                 &fillColor_, const   current fuzz setting when determining
                 Color &borderColor_  color match.

                 const Geometry
                 &point_, const Color
                 &fillColor_, const
                 Color &borderColor_

                 const long x_, const
                 long y_, const       Floodfill pixels matching color (within
 floodFillOpacityunsigned int         fuzz factor) of target pixel(x,y) with
                 opacity_, const      replacement opacity value using method.
                 PaintMethod method_


                 unsigned int x_,     Flood-fill texture across pixels that
 floodFill-      unsigned int y_,     match the color of the target pixel and
 Texture         const Image          are neighbors of the target pixel. Uses
                 &texture_            current fuzz setting when determining
                                      color match.

                 const Geometry
                 &point_, const Image
                 &texture_

                 unsigned int x_,     Flood-fill texture across pixels
                 unsigned int y_,     starting at target-pixel and stopping
                 const Image          at pixels matching specified border
                 &texture_, const     color. Uses current fuzz setting when
                 Color &borderColor_  determining color match.

                 const Geometry
                 &point_, const Image
                 &texture_, const
                 Color &borderColor_


 flop            void                 Flop image (reflect each scanline in
                                      the horizontal direction)

                 const Geometry
 frame           &geometry_ =         Add decorative frame around image
                 "25x25+6+6"

                 unsigned int width_,
                 unsigned int
                 height_, int x_, int
                 y_, int innerBevel_
                 = 0, int outerBevel_
                 = 0


 gamma           double gamma_        Gamma correct image (uniform red,
                                      green, and blue correction).

                 double gammaRed_,
                 double gammaGreen_,  Gamma correct red, green, and blue
                 double gammaBlue_    channels of image.

                                      Gaussian blur image. The number of
                                      neighbor pixels to be included in the
                                      convolution mask is specified by
 gaussianBlur    double width_,       'width_'.  For example, a width of one
                 double sigma_        gives a (standard) 3x3 convolution
                                      mask. The standard deviation of the
                                      Gaussian bell curve is specified by
                                      'sigma_'.

 implode         double factor_       Implode image (special effect)

                                      Assign a label to an image. Use this
                                      option to  assign  a  specific label to
                                      the image. Optionally you can include
                                      the image filename, type, width,
                                      height, or scene number in the label by
                                      embedding  special format characters.
 label           const string &label_ If the first character of string is @,
                                      the image label is read from a file
                                      titled by the remaining characters in
                                      the string. When converting to
                                      Postscript, use this  option to specify
                                      a header string to print above the
                                      image.

 magnify         void                 Magnify image by integral size

                                      Remap image colors with closest color
                                      from reference image. Set dither_ to
                                      true in to apply Floyd/Steinberg error
                 const Image          diffusion to the image. By default,
 map             &mapImage_ , bool    color reduction chooses an optimal
                 dither_ = false      set  of colors that best represent the
                                      original image. Alternatively, you can
                                      choose  a  particular  set  of colors
                                      from  an image file with this option.

                 const Color
                 &target_, unsigned
 matteFloodfill  int  opacity_, long  Floodfill designated area with a
                 x_, long y_,         replacement opacity value.
                 PaintMethod method_

                                      Filter image by replacing each pixel
 medianFilter    const double radius_ component with the median color in a
                 = 0.0
                                      circular neighborhood

 minify          void                 Reduce image by integral size

                                      Prepare to update image. Ensures that
                                      there is only one reference to the
                                      underlying image so that the underlying
 modifyImage     void                 image may be safely modified without
                                      effecting previous generations of the
                                      image. Copies the underlying image to a
                                      new image if necessary.

                 double brightness_,
 modulate        double saturation_,  Modulate percent hue, saturation, and
                 double hue_          brightness of an image

                                      Negate colors in image.  Replace every
                                      pixel with its complementary color
 negate          bool grayscale_ =    (white becomes black, yellow becomes
                 false
                                      blue, etc.).  Set grayscale to only
                                      negate grayscale values in image.

                                      Normalize image (increase contrast by
 normalize       void                 normalizing the pixel values to span
                                      the full range of color values).


 oilPaint        unsigned int radius_ Oilpaint image (image looks like oil
                 = 3                  painting)

                                      Set or attenuate the opacity channel in
                                      the image. If the image pixels are
                                      opaque then they are set to the
                                      specified opacity value, otherwise they
                                      are blended with the supplied opacity
 opacity         unsigned int         value.  The value of opacity_ ranges
                 opacity_
                                      from 0 (completely opaque) to MaxRGB.
                                      The defines OpaqueOpacity and
                                      TransparentOpacity are available to
                                      specify completely opaque or completely
                                      transparent, respectively.

                 const Color
 opaque          &opaqueColor_, const Change color of pixels matching
                 Color &penColor_     opaqueColor_ to specified penColor_.

                                      Ping is similar to read except only
                                      enough of the image is read to
                                      determine the image columns, rows, and
 ping            const std::string    filesize.  The columns, rows, and
                 &imageSpec_
                                      fileSize attributes are valid after
                                      invoking ping.  The image data is not
                                      valid after calling ping.

                                      Quantize image (reduce number of
 quantize        bool measureError_ = colors). Set measureError_ to true in
                 false
                                      order to calculate error attributes.

                 const Geometry
                                      Raise image (lighten or darken the
 raise           &geometry_ =         edges of an image to give a 3-D raised
                 "6x6+0+0",  bool
                 raisedFlag_ =  false or lowered effect)


 read            const string         Read image into current object
                 &imageSpec_

                                      Read image of specified size into
                                      current object. This form is useful for
                                      images that do not specifiy their size
                 const Geometry       or to specify a size hint for decoding
                                      an image. For example, when reading a
                 &size_, const        Photo CD, JBIG, or JPEG image, a size
                 std::string
                 &imageSpec_          request causes the library to return an
                                      image which is the next resolution
                                      greater or equal to the specified size.
                                      This may result in memory and time
                                      savings.

                                      Read encoded image of specified size
                                      from an in-memory BLOB into current
                                      object. Depending on the method
                                      arguments, the Blob size, depth, and
                                      format may also be specified. Some
                                      image formats require that size be
                                      specified. The default ImageMagick uses
                 const Blob &blob_    for depth depends on its Quantum size
                                      (8 or 16).  If ImageMagick's Quantum
                                      size does not match that of the image,
                                      the depth may need to be specified.
                                      ImageMagick can usually automatically
                                      detect the image's format. When a
                                      format can't be automatically detected,
                                      the format must be specified.

                 const Blob &blob_,
                 const Geometry
                 &size_

                 const Blob &blob_,
                 const Geometry
                 &size_, unsigned int
                 depth_

                 const Blob &blob_,
                 const Geometry
                 &size_, unsigned
                 short depth_, const
                 string &magick_

                 const Blob &blob_,
                 const Geometry
                 &size_, const string
                 &magick_

                                      Read image based on an array of image
                                      pixels. The pixel data must be in
                                      scanline order top-to-bottom. The data
                                      can be character, short int, integer,
                                      float, or double. Float and double
                                      require the pixels to be normalized
                                      [0..1]. The other types are
                                      [0..MaxRGB].  For example, to create a
                                      640x480 image from unsigned
                                      red-green-blue character data, use

                                        image.read( 640, 480, "RGB", 0,
                                      pixels );

                                      The parameters are as follows:

                                       width_ Width in pixels of the image.

                 const unsigned int    height_Height in pixels of the image.
                 width_, const
                 unsigned int                 This character string can be
                 height_, std::string         any combination or order of R
                 map_, const                  = red, G = green, B = blue, A
                 StorageType type_,           = alpha, C = cyan, Y = yellow
                 const void *pixels_   map_   M = magenta, and K = black.
                                              The ordering reflects the
                                              order of the pixels in the
                                              supplied pixel array.

                                              Pixel storage type (CharPixel,
                                       type_  ShortPixel, IntegerPixel,
                                              FloatPixel, or DoublePixel)

                                              This array of values contain
                                              the pixel components as
                                              defined by the map_ and type_
                                       pixels_parameters. The length of the
                                              arrays must equal the area
                                              specified by the width_ and
                                              height_ values and type_
                                              parameters.




 reduceNoise     void                 Reduce noise in image using a noise
                                      peak elimination filter.

                 unsigned int order_

                                      Roll image (rolls image vertically and
 roll            int columns_, int    horizontally) by specified number of
                 rows_
                                      columnms and rows)


 rotate          double degrees_      Rotate image counter-clockwise by
                                      specified number of degrees.


 sample          const Geometry       Resize image by using pixel sampling
                 &geometry_           algorithm


 scale           const Geometry       Resize image by using simple ratio
                 &geometry_           algorithm

                                      Segment (coalesce similar image
                                      components) by analyzing the histograms
                                      of the color components and identifying
                                      units that are homogeneous with the
                 double               fuzzy c-means technique. Also uses
                 clusterThreshold_ =  quantizeColorSpace and verbose image
                                      attributes. Specify clusterThreshold_,
 segment         1.0,                 as the number  of  pixels  each
                 double
                 smoothingThreshold_  cluster  must exceed the cluster
                 = 1.5                threshold to be considered valid.
                                      SmoothingThreshold_ eliminates noise in
                                      the  second derivative of the
                                      histogram. As the value is  increased,
                                      you can  expect  a  smoother second
                                      derivative.  The default is 1.5.

                                      Shade image using distant light source.
                 double azimuth_ =    Specify azimuth_ and elevation_ as the
                 30, double           position  of  the light source. By
 shade           elevation_ = 30,     default, the shading results as a
                 bool colorShading_ = grayscale image.. Set colorShading_ to
                 false                true to shade the red, green, and blue
                                      components of the image.

                                      Sharpen pixels in image.  The radius_
                 const double radius_ parameter specifies the radius of the
 sharpen         = 1, const double    Gaussian, in pixels, not counting the
                 sigma_ = 0.5         center pixel.  The sigma_ parameter
                                      specifies the standard deviation of the
                                      Laplacian, in pixels.


 shave           const Geometry       Shave pixels from image edges.
                 &geometry_

                                      Shear image (create parallelogram by
                                      sliding image by X or Y axis).
                                      Shearing slides one edge of an image
                                      along the X  or  Y axis,  creating  a
                                      parallelogram.  An X direction shear
                                      slides an edge along the X axis, while
                                      a  Y  direction shear  slides  an edge
 shear           double xShearAngle_, along the Y axis.  The amount of the
                 double yShearAngle_  shear is controlled by a shear angle.
                                      For X direction  shears,  x  degrees is
                                      measured relative to the Y axis, and
                                      similarly, for Y direction shears  y
                                      degrees is measured relative to the X
                                      axis. Empty triangles left over from
                                      shearing the  image  are filled  with
                                      the  color  defined as borderColor.

                                      Solarize image (similar to effect seen
 solarize        double factor_ =     when exposing a photographic film to
                 50.0
                                      light during the development process)


 spread          unsigned int amount_ Spread pixels randomly within image by
                 = 3                  specified amount


 stegano         const Image          Add a digital watermark to the image
                 &watermark_          (based on second image)

                                      Create an image which appears in stereo
 stereo          const Image          when viewed with red-blue glasses (Red
                 &rightImage_
                                      image on left, blue on right)


 swirl           double degrees_      Swirl image (image pixels are rotated
                                      by degrees)


 texture         const Image          Layer a texture on pixels matching
                 &texture_            image background color.

 threshold       double threshold_    Threshold image


 transform       const Geometry       Transform image based on image and crop
                 &imageGeometry_      geometries. Crop geometry is optional.

                 const Geometry
                 &imageGeometry_,
                 const Geometry
                 &cropGeometry_


 transparent     const Color &color_  Add matte image to image, setting
                                      pixels matching color to transparent.


 trim            void                 Trim edges that are the background
                                      color from the image.

                                      Replace image with a sharpened version
                                      of the original image using the unsharp
                                      mask algorithm. The radius_ parameter
                                      specifies the radius of the Gaussian,
                                      in pixels, not counting the center
                 double radius_,      pixel. The sigma_ parameter specifies
 unsharpmask     double sigma_,       the standard deviation of the Gaussian,
                 double amount_,      in pixels. The amount_ parameter
                 double threshold_    specifies the percentage of the
                                      difference between the original and the
                                      blur image that is added back into the
                                      original. The threshold_ parameter
                                      specifies the threshold in pixels
                                      needed to apply the diffence amount.

                 double amplitude_ =
 wave            25.0, double         Alter an image along a sine wave.
                 wavelength_ = 150.0

                                      Write image to a file using filename
                                      imageSpec_.
                                      Caution: if an image format is selected
                                      which is capable of supporting fewer
 write           const string         colors than the original image or
                 &imageSpec_
                                      quantization has been requested, the
                                      original image will be quantized to
                                      fewer colors. Use a copy of the
                                      original if this is a problem.

                                      Write image to a in-memory BLOBstored
                                      in blob_. The magick_ parameter
                                      specifies the image format to write
                                      (defaults to magick ). The depth_
                                      parameter species the image depth
                                      (defaults to depth).
                 Blob *blob_          Caution: if an image format is selected
                                      which is capable of supporting fewer
                                      colors than the original image or
                                      quantization has been requested, the
                                      original image will be quantized to
                                      fewer colors. Use a copy of the
                                      original if this is a problem.


                 Blob *blob_,
                 std::string &magick_

                 Blob *blob_,
                 std::string
                 &magick_, unsigned
                 int depth_

                                      Write pixel data into a buffer you
                                      supply. The data is saved either as
                                      char, short int, integer, float or
                                      double format in the order specified by
                                      the type_ parameter. For example, we
                                      want to extract scanline 1 of a 640x480
                                      image as character data in
                                      red-green-blue order:


                                      image.write(0,0,640,1,"RGB",0,pixels);

                                      The parameters are as follows:

                                               Horizontal ordinate of
                                       x_      left-most coordinate of
                                               region to extract.

                                               Vertical ordinate of top-most
                                       y_      coordinate of region to
                                               extract.

                 const int x_, const           Width in pixels of the region
                 int y_, const         columns_to extract.
                 unsigned int
                 columns_, const
                 unsigned int rows_,   rows_   Height in pixels of the
                 const std::string             region to extract.
                 &map_, const
                 StorageType type_,            This character string can be
                 void *pixels_                 any combination or order of R
                                               = red, G = green, B = blue, A
                                       map_    = alpha, C = cyan, Y =
                                               yellow, M = magenta, and K =
                                               black. The ordering reflects
                                               the order of the pixels in
                                               the supplied pixel array.

                                               Pixel storage type
                                       type_   (CharPixel, ShortPixel,
                                               IntegerPixel, FloatPixel, or
                                               DoublePixel)

                                               This array of values contain
                                               the pixel components as
                                               defined by the map_ and type_
                                       pixels_ parameters. The length of the
                                               arrays must equal the area
                                               specified by the width_ and
                                               height_ values and type_
                                               parameters.




 zoom            const Geometry       Zoom image to specified size.
                 &geometry_


Image Attributes

Image attributes are set and obtained via methods in Image. Except for
methods which accept pointer arguments (e.g. chromaBluePrimary) all methods
return attributes by value.

The supported image attributes and the method arguments required to obtain
them are shown in the following table:

                                 Image Image Attributes

 Attribute       Type             Get          Set Signature      Description
                                  Signature

                                                                  Join images into a
 adjoin          bool             void         bool flag_         single multi-image
                                                                  file.

                                                                  Control antialiasing
                                                                  of rendered
 antiAlias       bool             void         bool flag_         Postscript and
                                                                  Postscript or
                                                                  TrueType fonts.
                                                                  Enabled by default.

                                                                  Time in 1/100ths of a
                                                                  second (0 to 65535)
                                                                  which must expire
                                                                  before displaying the
                                                                  next image in an
 animation-      unsigned int (0               unsigned int       animated sequence.
 Delay           to 65535)        void         delay_             This option is useful
                                                                  for regulating the
                                                                  animation of a
                                                                  sequence  of GIF
                                                                  images within
                                                                  Netscape.

                                                                  Number of iterations
 animation-                                    unsigned int       to loop an animation
 Iterations      unsigned int     void         iterations_        (e.g. Netscape loop
                                                                  extension) for.

 background-                                   const Color        Image background
 Color           Color            void         &color_            color

                                                                  Image file name to
 background-                                   const string       use as the background
 Texture         string           void         &texture_          texture. Does not
                                                                  modify image pixels.

                                                                  Base image width
 baseColumns     unsigned int     void                            (before
                                                                  transformations)

                                                                  Base image filename
 baseFilename    string           void                            (before
                                                                  transformations)

                                                                  Base image height
 baseRows        unsigned int     void                            (before
                                                                  transformations)


 borderColor     Color            void          const Color       Image border color
                                               &color_

                                                                  Return smallest
                                                                  bounding box
                                                                  enclosing non-border
                                                                  pixels. The current
 boundingBox     Geometry         void                            fuzz value is used
                                                                  when discriminating
                                                                  between pixels. This
                                                                  is the crop bounding
                                                                  box used by
                                                                  crop(Geometry(0,0)).

                                                                  Base color that
 boxColor        Color            void         const Color        annotation text is
                                               &boxColor_
                                                                  rendered on.

                                                                  Pixel cache threshold
                                                                  in megabytes. Once
                                                                  this threshold is
                                                                  exceeded, all
                                                                  subsequent pixels
 cacheThreshold  unsigned int                  unsigned int       cache operations are
                                                                  to/from disk. This is
                                                                  a static method and
                                                                  the attribute it sets
                                                                  is shared by all
                                                                  Image objects.


 chroma-                          float *x_,                      Chromaticity blue
 BluePrimary     float x & y      float *y_    float x_, float y_ primary point (e.g.
                                                                  x=0.15, y=0.06)


 chroma-                          float *x_,                      Chromaticity green
 GreenPrimary    float x & y      float *y_    float x_, float y_ primary point (e.g.
                                                                  x=0.3, y=0.6)


 chroma-                          float *x_,                      Chromaticity red
 RedPrimary      float x & y      float *y_    float x_, float y_ primary point (e.g.
                                                                  x=0.64, y=0.33)


 chroma-                          float *x_,                      Chromaticity white
 WhitePoint      float x & y      float *y_    float x_, float y_ point (e.g. x=0.3127,
                                                                  y=0.329)

                                                                  Image storage class.
                                                                  Note that conversion
                                                                  from a DirectClass
                                                                  image to a
 classType       ClassType        void          ClassType class_  PseudoClass image may
                                                                  result in a loss of
                                                                  color due to the
                                                                  limited size of the
                                                                  palette (256 or 65535
                                                                  colors).

                                                                  Associate a clip mask
                                                                  image with the
                                                                  current image. The
                                                                  clip mask image must
                                                                  have the same
                                                                  dimensions as the
                                                                  current image or an
 clipMask        Image            void         const Image        exception is thrown.
                                               &clipMask_         Clipping occurs
                                                                  wherever pixels are
                                                                  transparent in the
                                                                  clip mask image.
                                                                  Clipping Pass an
                                                                  invalid image to
                                                                  unset an existing
                                                                  clip mask.

                                                                  Colors within this
                                                                  distance are
                                                                  considered equal. A
                                                                  number of algorithms
                                                                  search for a target
 colorFuzz       double           void         double fuzz_       color. By default the
                                                                  color must be exact.
                                                                  Use this option to
                                                                  match colors that are
                                                                  close to the target
                                                                  color in RGB space.

                                               unsigned int
 colorMap        Color            unsigned int index_, const      Color at color-pallet
                                  index_                          index.
                                               Color &color_

                                                                  The colorspace (e.g.
                                                                  CMYK) used to
                                                                  represent the image
 colorSpace      ColorspaceType   void         ColorspaceType     pixel colors. Image
                 colorSpace_                   colorSpace_        pixels are always
                                                                  stored as RGB(A)
                                                                  except for the case
                                                                  of CMY(K).

 columns         unsigned int     void                            Image width

 comment         string           void                            Image comment

                                                                  Image compresion
 compress-                                     CompressionType    type. The default is
 Type            CompressionType  void         compressType_      the compression type
                                                                  of the specified
                                                                  image file.

                                                                  Vertical and
                                                                  horizontal resolution
                                                                  in pixels of the
                                                                  image. This option
 density         Geometry         void         const Geometry     specifies an image
                 (default 72x72)               &density_          density when decoding
                                                                  a Postscript or
                                                                  Portable Document
                                                                  page. Often used with
                                                                  psPageSize.

                                                                  Image depth. Used to
                                                                  specify the bit depth
                                                                  when reading or
                                                                  writing  raw images
                                                                  or when the output
 depth            unsigned int (8 void         unsigned int       format supports
                 or 16)                        depth_
                                                                  multiple depths.
                                                                  Defaults to the
                                                                  quantum depth that
                                                                  ImageMagick is
                                                                  compiled with.

                                                                  Specify (or obtain)
 endian          EndianType       void         EndianType endian_ endian option for
                                                                  formats which support
                                                                  it.

                                                                  Tile names from
 directory       string           void                            within an image
                                                                  montage


 fileName        string           void         const string       Image file name.
                                               &fileName_


 fileSize        off_t            void                            Number of bytes of
                                                                  the image on disk


 fillColor       Color            void         const Color        Color to use when
                                               &fillColor_        filling drawn objects

                                                                  Pattern image to use
 fillPattern     Image            void         const Image        when filling drawn
                                               &fillPattern_
                                                                  objects.

                                               const              Rule to use when
 fillRule        FillRule         void         Magick::FillRule   filling drawn
                                               &fillRule_         objects.

                                                                  Filter to use when
                                                                  resizing image. The
                                                                  reduction filter
                                                                  employed has a
                                                                  sigificant effect on
                                                                  the time required to
 filterType      FilterTypes      void         FilterTypes        resize an image and
                                               filterType_        the resulting
                                                                  quality. The default
                                                                  filter is Lanczos
                                                                  which has been shown
                                                                  to produce high
                                                                  quality results when
                                                                  reducing most images.

                                                                  Text rendering font.
                                                                  If the font is a
                                                                  fully qualified X
                                                                  server font name, the
                                                                  font is obtained from
                                                                  an X  server. To use
 font            string           void         const string       a TrueType font,
                                               &font_
                                                                  precede the TrueType
                                                                  filename with an @.
                                                                  Otherwise, specify
                                                                  a  Postscript font
                                                                  name (e.g.
                                                                  "helvetica").


 fontPointsize   unsigned int     void         unsigned int       Text rendering font
                                               pointSize_         point size


                                  const                           Update metrics with
                                  std::string                     font type metrics
 fontTypeMetrics TypeMetric       &text_,                         using specified text,
                                  TypeMetric                      and current font and
                                  *metrics                        fontPointSize
                                                                  settings.


 format          string           void                            Long form image
                                                                  format description.

                                                                  Gamma level of the
                                                                  image. The same color
                                                                  image displayed on
                                                                  two different
                 double (typical                                  workstations  may
 gamma           range 0.8 to     void                            look  different due
                 2.3)                                             to differences in the
                                                                  display monitor.  Use
                                                                  gamma correction  to
                                                                  adjust  for this
                                                                  color  difference.


 geometry        Geometry         void                            Preferred size of the
                                                                  image when encoding.

                 unsigned int
                 { 0 = Disposal
                 not specified,
                 1 = Do not                                       GIF disposal method.
                 dispose of                                       This option is used
                 graphic,                                         to control how
 gifDispose-     3 = Overwrite                 unsigned int       successive frames are
 Method          graphic with     void         disposeMethod_     rendered (how the
                 background                                       preceding frame is
                 color,                                           disposed of) when
                 4 = Overwrite                                    creating a GIF
                 graphic with                                     animation.
                 previous
                 graphic. }

                                                                  ICC color profile.
                                                                  Supplied via a Blob
                                                                  since Magick++/ and
                                                                  ImageMagick do not
                                                                  currently support
                                                                  formating this data
 iccColorProfile Blob             void         const Blob         structure directly.
                                               &colorProfile_
                                                                  Specifications are
                                                                  available from the
                                                                  International Color
                                                                  Consortium for the
                                                                  format of ICC color
                                                                  profiles.

                                                                  The type of
                                                                  interlacing scheme
                                                                  (default
                                                                  NoInterlace). This
                                                                  option is used to
                                                                  specify the type of
                                                                  interlacing scheme
                                                                  for  raw  image
                                                                  formats such as RGB
                                                                  or YUV. NoInterlace
                                                                  means do not
                                                                  interlace,
                                                                  LineInterlace uses
                                                                  scanline interlacing,
 interlace-                                    InterlaceType      and PlaneInterlace
 Type            InterlaceType    void         interlace_         uses plane
                                                                  interlacing.
                                                                  PartitionInterlace is
                                                                  like PlaneInterlace
                                                                  except the  different
                                                                  planes  are saved  to
                                                                  individual files
                                                                  (e.g.  image.R,
                                                                  image.G, and
                                                                  image.B). Use
                                                                  LineInterlace or
                                                                  PlaneInterlace to
                                                                  create an interlaced
                                                                  GIF or progressive
                                                                  JPEG image.

                                                                  IPTC profile.
                                                                  Supplied via a Blob
                                                                  since Magick++ and
                                                                  ImageMagick do not
                                                                  currently  support
                                                                  formating this data
 iptcProfile     Blob             void         const Blob&        structure directly.
                                               iptcProfile_
                                                                  Specifications are
                                                                  available from the
                                                                  International Press
                                                                  Telecommunications
                                                                  Council for IPTC
                                                                  profiles.


 label           string           void         const string       Image label
                                               &label_


 magick          string           void          const string      Get image format
                                               &magick_           (e.g. "GIF")

                                                                  True if the image has
                                                                  transparency. If set
 matte           bool             void         bool matteFlag_    True, store matte
                                                                  channel if  the image
                                                                  has one otherwise
                                                                  create an opaque one.


 matteColor      Color            void         const Color        Image matte
                                               &matteColor_       (transparent) color

                                                                  The mean error per
                                                                  pixel computed when
                                                                  an image is color
 meanError-                                                       reduced. This
 PerPixel        double           void                            parameter is only
                                                                  valid if verbose is
                                                                  set to true and the
                                                                  image has just been
                                                                  quantized.


 monochrome      bool             void         bool flag_         Transform the image
                                                                  to black and white

                                                                  Tile size and offset
 montage-                                                         within an image
 Geometry        Geometry         void                            montage. Only valid
                                                                  for montage images.

                                                                  The normalized max
                                                                  error per pixel
                                                                  computed when an
                                                                  image is color
 normalized-                                                      reduced. This
 MaxError        double           void                            parameter is only
                                                                  valid if verbose is
                                                                  set to true and the
                                                                  image has just been
                                                                  quantized.

                                                                  The normalized mean
                                                                  error per pixel
                                                                  computed when an
                                                                  image is color
 normalized-                                                      reduced. This
 MeanError       double           void                            parameter is only
                                                                  valid if verbose is
                                                                  set to true and the
                                                                  image has just been
                                                                  quantized.

                                                                  The number of
 packets         unsigned int     void                            runlength-encoded
                                                                  packets in
                                                                  the image


 packetSize      unsigned int     void                            The number of bytes
                                                                  in each pixel packet

                                                                  Preferred size and
                                                                  location of an image
                                                                  canvas.

                                                                  Use this option to
                                                                  specify the
                                                                  dimensions and
                                                                  position of the
                                                                  Postscript page in
 page            Geometry         void         const Geometry     dots per inch or a
                                               &pageSize_         TEXT page in pixels.
                                                                  This option is
                                                                  typically used in
                                                                  concert with density.

                                                                  Page may also be used
                                                                  to position a GIF
                                                                  image (such as for a
                                                                  scene in an
                                                                  animation)


                                  unsigned int unsigned int x_,
 pixelColor      Color            x_, unsigned unsigned int y_,   Get/set pixel color
                                  int y_       const Color        at location x & y.
                                               &color_

                                                                  JPEG/MIFF/PNG
 quality         unsigned int (0  void         unsigned int       compression level
                 to 100)                       quality_
                                                                  (default 75).

                                                                  Preferred number of
                                                                  colors in the image.
                                                                  The actual number of
                                                                  colors in the image
                                                                  may be less than your
 quantize-                                     unsigned int       request, but never
 Colors          unsigned int     void         colors_            more. Images with
                                                                  less unique colors
                                                                  than specified with
                                                                  this option will have
                                                                  any duplicate or
                                                                  unused colors
                                                                  removed.

                                                                  Colorspace to
                                                                  quantize colors in
                                                                  (default RGB).
                                                                  Empirical evidence
                                                                  suggests that
                                                                  distances in color
                                                                  spaces such as YUV or
 quantize-                                     ColorspaceType     YIQ correspond to
 ColorSpace      ColorspaceType   void         colorSpace_        perceptual color
                                                                  differences more
                                                                  closely than do
                                                                  distances in RGB
                                                                  space. These color
                                                                  spaces may give
                                                                  better results when
                                                                  color reducing an
                                                                  image.

                                                                  Apply Floyd/Steinberg
                                                                  error diffusion to
                                                                  the image. The basic
                                                                  strategy of dithering
                                                                  is to  trade
                                                                  intensity resolution
                                                                  for  spatial
                                                                  resolution  by
                                                                  averaging the
                                                                  intensities  of
 quantize-                                                        several  neighboring
 Dither          bool             void         bool flag_         pixels. Images which
                                                                  suffer  from  severe
                                                                  contouring  when
                                                                  reducing colors can
                                                                  be improved with this
                                                                  option. The
                                                                  quantizeColors or
                                                                  monochrome option
                                                                  must be set for this
                                                                  option to take
                                                                  effect.

                                                                  Depth of the
                                                                  quantization color
                                                                  classification tree.
                                                                  Values of 0 or 1
                                                                  allow selection of
 quantize-                                     unsigned int       the optimal tree
 TreeDepth       unsigned int     void         treeDepth_         depth for the color
                                                                  reduction algorithm.
                                                                  Values between 2 and
                                                                  8 may be used to
                                                                  manually adjust the
                                                                  tree depth.

 rendering-                                    RenderingIntent    The type of rendering
 Intent          RenderingIntent  void         render_            intent

 resolution-                                   ResolutionType     Units of image
 Units           ResolutionType   void         units_             resolution


 rows            unsigned int     void                            The number of pixel
                                                                  rows in the image


 scene           unsigned int     void         unsigned int       Image scene number
                                               scene_

                                                                  Image MD5 signature.
                                                                  Set force_ to 'true'
 signature       string           bool force_                     to force
                                  = false
                                                                  re-computation of
                                                                  signature.

                                                                  Width and height of a
                                                                  raw image (an image
                                                                  which does not
                                                                  support width and
                                                                  height information).
 size            Geometry         void         const Geometry     Size may also be used
                                               &geometry_
                                                                  to affect the image
                                                                  size read from a
                                                                  multi-resolution
                                                                  format (e.g. Photo
                                                                  CD, JBIG, or JPEG.

                                                                  Enable or disable
 strokeAntiAlias bool             void         bool flag_         anti-aliasing when
                                                                  drawing object
                                                                  outlines.

                                                                  Color to use when
 strokeColor     Color            void         const Color        drawing object
                                               &strokeColor_
                                                                  outlines

                                                                  While drawing using a
                                                                  dash pattern, specify
 strokeDashOffsetunsigned int     void         double             distance into the
                                               strokeDashOffset_
                                                                  dash pattern to start
                                                                  the dash (default 0).

                                                                  Specify the pattern
                                                                  of dashes and gaps
                                                                  used to stroke paths.
                                                                  The strokeDashArray
                                                                  represents a
                                                                  zero-terminated array
                                                                  of numbers that
                                                                  specify the lengths
                                                                  (in pixels) of
                                                                  alternating dashes
                                                                  and gaps in user
 strokeDashArray const double*    void         const double*      units. If an odd
                                               strokeDashArray_   number of values is
                                                                  provided, then the
                                                                  list of values is
                                                                  repeated to yield an
                                                                  even number of
                                                                  values.  A typical
                                                                  strokeDashArray_
                                                                  array might contain
                                                                  the members 5 3 2 0,
                                                                  where the zero value
                                                                  indicates the end of
                                                                  the pattern array.

                                                                  Specify the shape to
                                                                  be used at the
                                                                  corners of paths (or
                                                                  other vector shapes)
 strokeLineCap   LineCap          void         LineCap lineCap_   when they are
                                                                  stroked. Values of
                                                                  LineJoin are
                                                                  UndefinedJoin,
                                                                  MiterJoin, RoundJoin,
                                                                  and BevelJoin.

                                                                  Specify the shape to
                                                                  be used at the
                                                                  corners of paths (or
                                                                  other vector shapes)
 strokeLineJoin  LineJoin         void         LineJoin lineJoin_ when they are
                                                                  stroked. Values of
                                                                  LineJoin are
                                                                  UndefinedJoin,
                                                                  MiterJoin, RoundJoin,
                                                                  and BevelJoin.

                                                                  Specify miter limit.
                                                                  When two line
                                                                  segments meet at a
                                                                  sharp angle and miter
                                                                  joins have been
                                                                  specified for
                                                                  'lineJoin', it is
                                                                  possible for the
 strokeMiterLimitunsigned int     void         unsigned int       miter to extend far
                                               miterLimit_        beyond the thickness
                                                                  of the line stroking
                                                                  the path. The
                                                                  miterLimit' imposes a
                                                                  limit on the ratio of
                                                                  the miter length to
                                                                  the 'lineWidth'. The
                                                                  default value of this
                                                                  parameter is 4.

                                                                  Stroke width for use
 strokeWidth     double           void         double             when drawing vector
                                               strokeWidth_
                                                                  objects (default one)

                                                                  Pattern image to use
 strokePattern   Image            void         const Image        while drawing object
                                               &strokePattern_
                                                                  stroke (outlines).


 subImage        unsigned int     void         unsigned int       Subimage of an image
                                               subImage_          sequence

                                                                  Number of images
 subRange        unsigned int     void         unsigned int       relative to the base
                                               subRange_
                                                                  image


 tileName        string           void         const string       Tile name
                                               &tileName_


 totalColors     unsigned long    void                            Number of colors in
                                                                  the image

 type            ImageType        void         ImageType          Image type.

                                                                  Print detailed
 verbose         bool             void         bool verboseFlag_  information about the
                                                                  image


 view            string           void         const string       FlashPix viewing
                                               &view_             parameters.

                                                                  X11 display to
 x11Display      string (e.g.     void         const string       display to, obtain
                 "hostname:0.0")               &display_          fonts from, or to
                                                                  capture image from


 xResolution     double           void                            x resolution of the
                                                                  image


 yResolution     double           void                            y resolution of the
                                                                  image


Raw Image Pixel Access

Image pixels (of type PixelPacket) may be accessed directly via the Image
Pixel Cache.  The image pixel cache is a rectangular window into the actual
image pixels (which may be in memory, memory-mapped from a disk file, or
entirely on disk). Two interfaces exist to access the Image Pixel Cache. The
interface described here (part of the Image class) supports only one view at
a time. See the Pixels class for a more abstract interface which supports
simultaneous pixel views (up to the number of rows). As an analogy, the
interface described here relates to the Pixels class as stdio's gets()
relates to fgets(). The Pixels class provides the more general form of the
interface.

Obtain existing image pixels via getPixels(). Create a new pixel region
using setPixels().

Depending on the capabilities of the operating system, and the relationship
of the window to the image, the pixel cache may be a copy of the pixels in
the selected window, or it may be the actual image pixels. In any case
calling syncPixels() insures that the base image is updated with the
contents of the modified pixel cache. The method readPixels() supports
copying foreign pixel data formats into the pixel cache according to the
QuantumTypes. The method writePixels() supports copying the pixels in the
cache to a foreign pixel representation according to the format specified by
QuantumTypes.

The pixel region is effectively a small image in which the pixels may be
accessed, addressed, and updated, as shown in the following example:
Image image("cow.png");
// Obtain pixel region with size 60x40, and top origin at 20x30

int columns = 60;
PixelPacket *pixel_cache = image.GetPixels(20,30,columns,40);
// Set pixel at column 5, and row 10 in the pixel cache to red.

int column = 5;                                                  [Cache.png]
int row = 10;
PixelPacket *pixel =
pixel_cache+row*columns*sizeof(PixelPacket)+column;
pixel = Color("red");
// Save updated pixel cache back to underlying image
image.syncPixels();
image.write("horse.png");


The image cache supports the following methods:

                             Image Cache Methods

 Method          Returns         Signature           Description


                                 int x_, int y_,     Transfers pixels from
                                                     the image to the pixel
 getConstPixels  const           unsigned int        cache as defined by
                 PixelPacket*    columns_, unsigned
                                 int rows_           the specified
                                                     rectangular region.

                                                     Returns a pointer to
                                                     the Image pixel
                                                     indexes. Only valid
                                                     for PseudoClass images
                                                     or CMYKA images. The
                                                     pixel indexes
                                                     represent an array of
                                                     type IndexPacket, with
                                                     each entry
 getConstIndexes const           void                corresponding to an
                 IndexPacket*                        x,y pixel position.
                                                     For PseudoClass
                                                     images, the entry's
                                                     value is the offset
                                                     into the colormap (see
                                                     colorMap) for that
                                                     pixel. For CMYKA
                                                     images, the indexes
                                                     are used to contain
                                                     the alpha channel.

                                                     Returns a pointer to
                                                     the Image pixel
                                                     indexes corresponding
                                                     to the pixel region
                                                     requested by the last
                                                     getConstPixels,
                                                     getPixels, or
                                                     setPixels call. Only
                                                     valid for PseudoClass
                                                     images or CMYKA
                                                     images. The pixel
                                                     indexes represent an
 getIndexes      IndexPacket*    void                array of type
                                                     IndexPacket, with each
                                                     entry corresponding to
                                                     a pixel x,y position.
                                                     For PseudoClass
                                                     images, the entry's
                                                     value is the offset
                                                     into the colormap (see
                                                     colorMap)  for that
                                                     pixel. For CMYKA
                                                     images, the indexes
                                                     are used to contain
                                                     the alpha channel.

                                                     Transfers pixels from
                                                     the image to the pixel
                                                     cache as defined by
                                 int x_, int y_,     the specified
 getPixels       PixelPacket*    unsigned int        rectangular region.
                                 columns_, unsigned  Modified pixels may be
                                 int rows_           subsequently
                                                     transferred back to
                                                     the image via
                                                     syncPixels.

                                                     Allocates a pixel
                                                     cache region to store
                                 int x_, int y_,     image pixels as
                                                     defined by the region
 setPixels       PixelPacket*    unsigned int        rectangle.  This area
                                 columns_, unsigned
                                 int rows_           is subsequently
                                                     transferred from the
                                                     pixel cache to the
                                                     image via syncPixels.

                                                     Transfers the image
 syncPixels      void            void                cache pixels to the
                                                     image.

                                                     Transfers one or more
                                                     pixel components from
                                                     a buffer or file into
                                 QuantumTypes        the image pixel cache
 readPixels      void            quantum_, unsigned  of an image.
                                 char *source_,      ReadPixels is
                                                     typically used to
                                                     support image
                                                     decoders.

                                                     Transfers one or more
                                                     pixel components from
                                 QuantumTypes        the image pixel cache
 writePixels     void            quantum_, unsigned  to a buffer or file.
                                 char *destination_  WritePixels is
                                                     typically used to
                                                     support image
                                                     encoders.



\end{verbatim}
}
