Magick::Image Class
Image is the primary object in Magick++ and represents a single image frame (see design ). The -STL interface must be used to operate on +STL interface must be used to operate on image sequences or images (e.g. of format GIF, TIFF, MIFF, Postscript, & MNG) which are comprised of multiple image frames. Individual frames of a multi-frame image may be requested by adding array-style @@ -65,7 +84,7 @@ 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 + href="../Magick++/Pixels.html"> 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++ @@ -194,7 +213,7 @@ 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 +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 @@ -253,7 +272,7 @@ image.read( blob);
@@ -275,15 +294,15 @@ to select a specific scene from a multi-frame image.
const size_t height_,
std::string map_,
- const + const StorageType type_,
const void *pixels_
Image manipulation methods are very easy to use. For example:
@@ -420,7 +439,7 @@ compute the threshold.
- addNoise NoiseType + NoiseType noiseType_ Add noise to image with specified noise type. @@ -454,13 +473,13 @@ specified affine (or free transform) matrix.
annotate const std::string &text_, const Geometry &location_ + href="../Magick++/Geometry.html"> Geometry &location_Annotate using specified text, and placement location - string text_, const Geometry -&boundingArea_, GravityType + string text_, const Geometry +&boundingArea_, GravityType gravity_ Annotate using specified text, bounding area, and placement gravity. If boundingArea_ is invalid, then @@ -468,8 +487,8 @@ bounding area is entire image. const std::string &text_, const Geometry &boundingArea_, GravityType gravity_, double + href="../Magick++/Geometry.html"> Geometry &boundingArea_, GravityType gravity_, double degrees_, Annotate with text using specified text, bounding area, placement gravity, and rotation. If boundingArea_ @@ -477,7 +496,7 @@ is invalid, then bounding area is entire image. @@ -512,7 +531,7 @@ deviation of the Laplacian, in pixels. const std::string &text_, GravityType gravity_ + href="../Magick++/Enumerations.html#GravityType"> GravityType gravity_Annotate with text (bounding area is entire image) and placement gravity. - border const Geometry + const Geometry &geometry_ = "6x6+0+0" Border image (add border to image). The color of the border is specified by the borderColor attribute. @@ -528,7 +547,7 @@ color of the border is specified by the borderColor attribute.channel -ChannelType + ChannelType layer_ Extract channel from image. Use this option to extract a particular channel from the image. MatteChannel @@ -550,7 +569,7 @@ parameter specifies the standard deviation of the Laplacian, in pixels. - chop const Geometry + const Geometry &geometry_ Chop image (remove vertical or horizontal subregion of image) @@ -582,7 +601,7 @@ image). By default, each image is commented with its file name. Use this method to assign a specific comment to the image. Optionally you can include the image filename, type, width, height, or other image attributes by embedding special format characters. + href="../Magick++/FormatCharacters.html">special format characters.
const Image &compositeImage_, ssize_t xOffset_, ssize_t yOffset_, CompositeOperator + href="../Magick++/Enumerations.html#CompositeOperator"> CompositeOperator compose_ = InCompositeOp Compose an image onto the current image at offset specified by xOffset_, yOffset_ using the @@ -614,8 +633,8 @@ composition algorithm specified by compose_. const Image -&compositeImage_, const Geometry -&offset_, CompositeOperator +&compositeImage_, const Geometry +&offset_, CompositeOperator compose_ = InCompositeOp Compose an image onto the current image at offset specified by offset_ using the composition algorithm @@ -623,8 +642,8 @@ specified by compose_ . @@ -695,12 +714,12 @@ distortion to the image. const Image -&compositeImage_, GravityType -gravity_, CompositeOperator +&compositeImage_, GravityType +gravity_, CompositeOperator compose_ = InCompositeOp Compose an image onto the current image with placement specified by gravity_ using the composition @@ -654,7 +673,7 @@ kernel to apply. - crop const Geometry + const Geometry &geometry_ Crop image (subregion of original image) - draw const Drawable + const Drawable &drawable_ Draw shape or text on image. - const std::list<Drawable + const std::list<Drawable > &drawable_ Draw shapes or text on image using a set of Drawable objects contained in an STL list. Use of this method improves @@ -752,22 +771,22 @@ background color. - extent const Geometry &geometry_ +const Geometry &geometry_ extends the image as defined by the geometry, gravity, and image background color. - const Geometry -&geometry_, const Color &backgroundColor_ +const Geometry +&geometry_, const Color &backgroundColor_ - const Geometry &geometry_, const GravityType + const Geometry &geometry_, const GravityType &gravity_ extends the image as defined by the geometry, gravity, and image background color. - const Geometry -&geometry_, const Color &backgroundColor_, -const GravityType &gravity_ +const Geometry +&geometry_, const Color &backgroundColor_, +const GravityType &gravity_ @@ -784,28 +803,28 @@ vertical direction) Colorssize_t x_, ssize_t y_, const Color &fillColor_ + href="../Magick++/Color.html"> Color &fillColor_Flood-fill color across pixels that match the color of the target pixel and are neighbors of the target pixel. Uses current fuzz setting when determining color match. - const Geometry -&point_, const Color &fillColor_ +const Geometry +&point_, const Color &fillColor_ ssize_t x_, ssize_t y_, const Color &fillColor_, const Color + href="../Magick++/Color.html"> Color &fillColor_, const Color &borderColor_ Flood-fill color across pixels starting at target-pixel and stopping at pixels matching specified border color. Uses current fuzz setting when determining color match. - const Geometry -&point_, const Color &fillColor_, -const Color &borderColor_ +const Geometry +&point_, const Color &fillColor_, +const Color &borderColor_ - const Geometry + const Geometry &point_, const Image &texture_ ssize_t x_, ssize_t y_, const Image -&texture_, const Color &borderColor_ +&texture_, const Color &borderColor_Flood-fill texture across pixels starting at target-pixel and stopping at pixels matching specified border color. Uses current fuzz setting when determining color match. - @@ -857,7 +876,7 @@ horizontal direction)const Geometry -&point_, const Image &texture_, const + const Geometry +&point_, const Image &texture_, const Color &borderColor_ - frame const Geometry + const Geometry &geometry_ = "25x25+6+6" Add decorative frame around image @@ -945,7 +964,7 @@ specified by 'sigma_'.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 +number in the label by embedding special format characters. If the first character of string is @, the image label is read from a file titled by the remaining characters in @@ -1019,10 +1038,10 @@ with this option. - matteFloodfill const Color + const Color &target_, const unsigned int opacity_, const ssize_t x_, const ssize_t -y_, PaintMethod method_ +y_, PaintMethod method_Floodfill designated area with a replacement opacity value. @@ -1037,7 +1056,7 @@ component with the median color in a circular neighborhood- mergeLayers LayerMethod + LayerMethod noiseType_ handle multiple images forming a set of image layers or animation frames. @@ -1129,8 +1148,8 @@ respectively.- opaque const Color -&opaqueColor_, const Color &penColor_ +const Color +&opaqueColor_, const Color &penColor_ Change color of pixels matching opaqueColor_ to specified penColor_. @@ -1178,7 +1197,7 @@ measureError_ to true in order to calculate error attributes.- raise const Geometry + const Geometry &geometry_ = "6x6+0+0", bool raisedFlag_ = false Raise image (lighten or darken the edges of an image to give a 3-D raised or lowered effect) @@ -1191,7 +1210,7 @@ an image to give a 3-D raised or lowered effect)Read image into current object - const Geometry + const Geometry &size_, const std::string &imageSpec_ Read image of specified size into current object. This form is useful for images that do not specify their size @@ -1201,9 +1220,9 @@ 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. - const Blob &blob_ +const Blob &blob_ Read encoded image of specified -size from an in-memory BLOB into current +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 for depth depends on its @@ -1214,22 +1233,22 @@ When a format can't be automagically detected, the format must be specified. - const Blob -&blob_, const Geometry &size_ +const Blob +&blob_, const Geometry &size_ - const Blob -&blob_, const Geometry &size_, + const Blob +&blob_, const Geometry &size_, size_t depth_ - const Blob -&blob_, const Geometry &size_, + const Blob +&blob_, const Geometry &size_, size_t depth_, const string &magick_ - @@ -1336,7 +1355,7 @@ number of degrees.const Blob -&blob_, const Geometry &size_, + const Blob +&blob_, const Geometry &size_, const string &magick_ - sample const Geometry + const Geometry &geometry_ Resize image by using pixel sampling algorithm @@ -1344,7 +1363,7 @@ number of degrees.- scale const Geometry + const Geometry &geometry_ Resize image by using simple ratio algorithm @@ -1451,7 +1470,7 @@ exposing a photographic film to light during the development process)splice -const Geometry + const Geometry &geometry_ splice the background color into the image @@ -1520,21 +1539,21 @@ background color.- transform const Geometry + const Geometry &imageGeometry_ Transform image based on image and crop geometries. Crop geometry is optional. - const Geometry -&imageGeometry_, const Geometry + const Geometry +&imageGeometry_, const Geometry &cropGeometry_ - transparent const Color + const Color &color_ Add matte image to image, setting pixels matching color to transparent. @@ -1605,9 +1624,9 @@ original image will be quantized to fewer colors. Use a copy of the original if this is a problem.- Blob *blob_ +Blob *blob_ Write image to a in-memory BLOB stored in blob_. The magick_ + href="../Magick++/Blob.html"> BLOB stored in blob_. The magick_ parameter specifies the image format to write (defaults to magick ). The depth_ parameter species the image depth (defaults to depth ).
@@ -1618,11 +1637,11 @@ original image will be quantized to fewer colors. Use a copy of the original if this is a problem.- Blob *blob_, + Blob *blob_, std::string &magick_ - Blob *blob_, + Blob *blob_, std::string &magick_, size_t depth_ @@ -1688,7 +1707,7 @@ values and type_ parameters. @@ -1805,9 +1824,9 @@ similar to "EXIF:DateTime".- resize const Geometry + const Geometry &geometry_ Resize image to specified size.
Color -Color +Color void -const Color + const Color &color_ Image background color @@ -1854,9 +1873,9 @@ texture. Does not modify image pixels.- borderColor Color +Color void -const Color + const Color &color_ Image border color @@ -1874,9 +1893,9 @@ crop(Geometry(0,0)).- boxColor Color +Color void -const Color + const Color &boxColor_ Base color that annotation text is rendered on. @@ -1971,10 +1990,10 @@ y=0.329)- classType ClassType + ClassType void -ClassType + ClassType class_ Image storage class. Note that conversion from a DirectClass image to a PseudoClass image may result @@ -2010,10 +2029,10 @@ are close to the target color in RGB space. - colorMap Color +Color size_t index_ size_t index_, const Color &color_ + href="../Magick++/Color.html"> Color &color_Color at colormap index. @@ -2041,10 +2060,10 @@ ensure that the image colormap indexes reference valid colormap entries.< @@ -2493,7 +2512,7 @@ using this method.- colorSpace ColorspaceType + ColorspaceType colorSpace_ void -ColorspaceType + ColorspaceType colorSpace_ The colorspace (e.g. CMYK) used to represent the image pixel colors. Image pixels are always stored as RGB(A) except @@ -2072,11 +2091,11 @@ for the case of CMY(K). - compose CompositeOperator + CompositeOperator void CompositeOperator + href="../Magick++/Enumerations.html#CompositeOperator">CompositeOperator compose_ Composition operator to be used when composition is implicitly used (such as for image flattening). @@ -2087,11 +2106,11 @@ composition is implicitly used (such as for image flattening).
Type -CompressionType + CompressionType void CompressionType + href="../Magick++/Enumerations.html#CompressionType">CompressionType compressType_ Image compresion type. The default is the compression type of the specified image file. @@ -2157,10 +2176,10 @@ exists.
- density Geometry + Geometry (default 72x72) void -const Geometry + const Geometry &density_ Vertical and horizontal resolution in pixels of the image. This option specifies an image density when decoding a @@ -2182,10 +2201,10 @@ ImageMagick is compiled with. - endian EndianType + EndianType void -EndianType + EndianType endian_ Specify (or obtain) endian option for formats which support it. @@ -2249,7 +2268,7 @@ objects.- fillRule FillRule + FillRule void const Magick::FillRule &fillRule_ @@ -2259,10 +2278,10 @@ objects.- filterType FilterTypes + FilterTypes void -FilterTypes + FilterTypes filterType_ Filter to use when resizing image. The reduction filter employed has a significant effect on the time required @@ -2296,9 +2315,9 @@ server. To use a TrueType font, precede the TrueType filename with an - fontTypeMetrics TypeMetric +TypeMetric const std::string &text_, TypeMetric *metrics + href="../Magick++/TypeMetric.html"> TypeMetric *metricsUpdate metrics with font type metrics using specified text, and current font and - geometry Geometry +Geometry void Preferred size of the image when encoding. @@ -2357,12 +2376,12 @@ disposed of) when creating a GIF animation.- iccColorProfile Blob +Blob void -const Blob + const Blob &colorProfile_ ICC color profile. Supplied via a Blob since Magick++/ and ImageMagick do not + href="../Magick++/Blob.html"> Blob since Magick++/ and ImageMagick do not currently support formating this data structure directly. Specifications are available from the International Color Consortium for the format of ICC color profiles. @@ -2373,10 +2392,10 @@ International Color Consortium for the format of ICC color profiles.<
Type -InterlaceType + InterlaceType void -InterlaceType + InterlaceType interlace_ The type of interlacing scheme (default NoInterlace ). This option is used to specify the type of interlacing @@ -2393,12 +2412,12 @@ image. - iptcProfile Blob +Blob void -const Blob & + const Blob & iptcProfile_ IPTC profile. Supplied via a Blob since Magick++ and ImageMagick do not + href="../Magick++/Blob.html"> Blob since Magick++ and ImageMagick do not currently support formating this data structure directly. Specifications are available from the International Press Telecommunications Council for IPTC profiles. @@ -2436,9 +2455,9 @@ an opaque one.- matteColor Color +Color void -const Color + const Color &matteColor_ Image matte (frame) color
Geometry -Geometry +Geometry void Tile size and offset within an image montage. @@ -2530,11 +2549,11 @@ is set to true and the image has just been quantized. name="orientation">orientation
OrientationType + href="../Magick++/Enumerations.html#OrientationType">OrientationTypevoid
OrientationType + href="../Magick++/Enumerations.html#OrientationType">OrientationType orientation_ Image orientation. Supported by some file formats such as DPX and TIFF. Useful for @@ -2565,11 +2584,11 @@ turning the right way up.
- page Geometry + Geometry void const Geometry &pageSize_ + href="../Magick++/Geometry.html#PostscriptPageSize"> Geometry &pageSize_Preferred size and location of an image canvas. Use this option to specify the dimensions @@ -2584,10 +2603,10 @@ image (such as for a scene in an animation)
- pixelColor Color +Color ssize_t x_, ssize_t y_ ssize_t x_, ssize_t y_, const Color &color_ + href="../Magick++/Color.html"> Color &color_Get/set pixel color at location x & y. @@ -2595,7 +2614,7 @@ image (such as for a scene in an animation) - @@ -2699,10 +2718,10 @@ render_Blob
+Blob
const std::string name_ @@ -2636,10 +2655,10 @@ option will have any duplicate or unused colors removed.
ColorSpace -ColorspaceType + ColorspaceType void -ColorspaceType + ColorspaceType colorSpace_ Colorspace to quantize colors in (default RGB). Empirical evidence suggests that distances in color spaces such @@ -2686,10 +2705,10 @@ may be used to manually adjust the tree depth.
Intent -RenderingIntent + RenderingIntent void -RenderingIntent + RenderingIntent render_ The type of rendering intent
Units -ResolutionType + ResolutionType void -ResolutionType + ResolutionType units_ Units of image resolution @@ -2738,9 +2757,9 @@ force re-computation of signature.- size Geometry +Geometry void -const Geometry + const Geometry &geometry_ Width and height of a raw image (an image which does not support width and height information). Size may @@ -2915,11 +2934,11 @@ designed to support Unicode.
- type ImageType + ImageType void ImageType + href="../Magick++/Enumerations.html#ImageType"> ImageTypeImage type. @@ -2944,11 +2963,11 @@ designed to support Unicode. @@ -2993,12 +3012,12 @@ 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 +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 +here relates to the Pixels class as +stdio's gets() relates to fgets(). The Pixels class provides the more general form of the interface.
- virtualPixelMethod VirtualPixelMethod + VirtualPixelMethod void VirtualPixelMethod + href="../Magick++/Enumerations.html#VirtualPixelMethod">VirtualPixelMethod virtualPixelMethod_ Image virtual pixel method. Obtain existing image pixels via getPixels(). Create a new pixel region using setPixels().
@@ -3023,7 +3042,7 @@ representation according to the format specified by QuantumTypes. may be accessed, addressed, and updated, as shown in the following example:-+
Image image("cow.png"); // Ensure that there are no other references to this image. image.modifyImage(); @@ -3158,7 +3177,7 @@ should never be deallocated by the user.
readPixels void -QuantumTypes + QuantumTypes quantum_, unsigned char *source_, Transfers one or more pixel components from a buffer or file into the image pixel cache of an image. ReadPixels is @@ -3170,7 +3189,7 @@ corresponds to the region set by a preceding setPixels call. writePixels void -QuantumTypes + QuantumTypes quantum_, unsigned char *destination_ Transfers one or more pixel components from the image pixel cache to a buffer or file. WritePixels is typically @@ -3182,21 +3201,27 @@ the region set by a preceding getPixels or getConstPixels call.