|
John Cristy ImageMagick Studio LLC http://www.imagemagick.org
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (ÏmageMagick"), to deal in ImageMagick without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of ImageMagick, and to permit persons to whom the ImageMagick is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of ImageMagick.
The software is provided äs is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall ImageMagick Studio be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with ImageMagick or the use or other dealings in ImageMagick.
Except as contained in this notice, the name of the ImageMagick Studio shall not be used in advertising or otherwise to promote the sale, use or other dealings in ImageMagick without prior written authorization from the ImageMagick Studio.
To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.
To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.
To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.
To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.
To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.
To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.
To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.
To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.
To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.
To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.
To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.
To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.
To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.
To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.
To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.
To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.
To start with we suggest that every heading is followed by at least a short passage of text in order to avoid a simple listing of different hierarchies.
Method ConstituteImage is a convenience routine that creates an image from the pixel data you supply and returns it. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. 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=ConstituteImage (640, 480, "RGB", 0, pixels, &exception)
Image \*ConstituteImage (const unsigned int width, const unsigned int height, const char \*map, const StorageType type, const void \*pixels, ExceptionInfo \*exception)
Method Constitute returns a pointer to the image. A null image is returned if there is a memory shortage or if the image cannot be read.
Specifies the width in pixels of the image.
Specifies the height in pixels of the image.
This character string can be any combination or order of R = red, G = green, B = blue, A = alpha, C = cyan, Y = yellow, M = magenta, and K = black. The ordering reflects the order of the pixels in the supplied pixel array.
pixel type where 0 = unsigned char, 1 = short int, 2 = int, 3 = float, and 4 = double. Float and double types are expected to be normalized [0..1] otherwise [0..MaxRGB].
This array of values contain the pixel components as defined by the map and type parameters. The length of the arrays must equal the area specified by the width and height values and type parameters.
return any errors or warnings in this structure.
Method DispatchImage is a convenience routine. Use it to extract pixel data from an image and place it in 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:
DispatchImage (image, 0, 0, 640, 1, "RGB", 0, pixels)
unsigned int DispatchImage (Image \*image, const int x, const int y, const unsigned int columns, const unsigned int rows, const char \*map, const StorageType type, void \*pixels)
Specifies a pointer to a Image structure returned from ReadImage.
These values define the perimeter of a region of pixels you want to extract.
This character string can be any combination or order of R = red, G = green, B = blue, A = alpha, C = cyan, Y = yellow, M = magenta, and K = black. The ordering reflects the order of the pixels in the supplied pixel array.
pixel type where 0 = unsigned char, 1 = short int, 2 = int, 3 = float, and 4 = double. Float and double types are expected to be normalized [0..1] otherwise [0..MaxRGB].
This array of values contain the pixel components as defined by the map and type parameters. The length of the arrays must equal the area specified by the width and height values and type parameters.
Method PingImage returns the image size in bytes if it exists and can be the image is returned as well. Note, only the first image in a multi-frame image file is pinged.
Image \*PingImage (const ImageInfo \*image_info, ExceptionInfo \*exception)
Method PingImage returns the image size in bytes if the image file exists and it size can be determined otherwise 0.
Specifies a pointer to an ImageInfo structure.
return any errors or warnings in this structure.
Method ReadImage reads an image and returns it. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. By default, the image format is determined by its magic number. To specify a particular image format, precede the filename with an explicit image format name and a colon (i.e. ps:image) or as the filename suffix (i.e. image.ps).
Image \*ReadImage (const ImageInfo \*image_info, ExceptionInfo \*exception)
Method ReadImage returns a pointer to the image after reading. A null image is returned if there is a memory shortage or if the image cannot be read.
Specifies a pointer to an ImageInfo structure.
return any errors or warnings in this structure.
Method ReadImages reads a list of image names from a file and then returns the images as a linked list.
Image \*ReadImages (const ImageInfo \*image_info, ExceptionInfo \*exception)
Method ReadImage returns a pointer to the image after reading. A null image is returned if there is a memory shortage or if the image cannot be read.
Specifies a pointer to an ImageInfo structure.
Method WriteImage writes an image to a file as defined by image->filename. You can specify a particular image format by prefixing the file with the image type and a colon (i.e. ps:image) or specify the image type as the filename suffix (i.e. image.ps). The image may be modified to adapt it to the requirements of the image format. For example, DirectClass images must be color-reduced to PseudoClass if the format is GIF.
unsigned int WriteImage (const ImageInfo \*image_info, Image \*image)
Method WriteImage return True if the image is written. False is returned is there is a memory shortage or if the image file fails to write.
Specifies a pointer to an ImageInfo structure.
A pointer to a Image structure.
Method AllocateImage allocates an Image structure and initializes each field to a default value.
Image \*AllocateImage (const ImageInfo \*image_info)
Method AllocateImage returns a pointer to an image structure initialized to default values. A null image is returned if there is a memory shortage.
Specifies a pointer to an ImageInfo structure.
Method AllocateImageColormap allocates an Image colormap and initializes it. The minimum number of colormap cells allocated is 256.
unsigned int AllocateImageColormap (Image \*image, const unsigned int colors)
Method AllocateImageColormap returns True if the colormap is successfully allocated and initialized, otherwise False.
The address of a structure of type Image.
The number of colors in the image colormap.
Method AllocateNextImage allocates an Image structure and initializes each field to a default value.
void AllocateNextImage (const ImageInfo \*image_info, Image \*image)
Specifies a pointer to an ImageInfo structure.
The address of a structure of type Image.
Method AnimateImages displays one or more images to an X window.
unsigned int AnimateImages (const ImageInfo \*image_info, Image \*image)
Method AnimateImages returns True if the images are displayed in an X window, otherwise False is returned.
Specifies a pointer to an ImageInfo structure.
The address of a structure of type Image.
Method AppendImages appends a sequence of images. All the input images must have the same width or height. Images of the same width are stacked top-to-bottom. Images of the same height are stacked left-to-right. If stack is false, rectangular images are stacked left-to-right otherwise top-to-bottom.
Image \*AppendImages (Image \*image, const unsigned int stack, ExceptionInfo \*exception)
The address of a structure of type Image returned from ReadImage.
An unsigned value other than stacks rectangular image top-to-bottom otherwise left-to-right.
return any errors or warnings in this structure.
Method AverageImages averages a sequence of images. All the input image must be the same size in pixels.
Image \*AverageImages (const Image \*image, ExceptionInfo \*exception)
Method AverageImages returns the mean pixel value for an image sequence.
The address of a structure of type Image returned from ReadImage.
return any errors or warnings in this structure.
Method ChannelImage extracts the specified channel from the referenced image.
unsigned int ChannelImage (Image \*image, const ChannelType channel)
The address of a structure of type Image returned from ReadImage.
A value of type ChannelType that identifies which channel to extract.
Method CloneImage clones an image. If the specified columns and rows is 0, an exact copy of the image is returned, otherwise the pixel data is undefined and must be initialized with SetImagePixels() and SyncImagePixels() methods.
Image \*CloneImage (Image \*image, const unsigned int columns, const unsigned int rows, const unsigned int orphan, ExceptionInfo \*exception)
Method CloneImage returns a pointer to the image after copying. A null image is returned if there is a memory shortage.
The address of a structure of type Image.
An integer that specifies the number of columns in the copied image.
An integer that specifies the number of rows in the copied image.
if true, consider this image an orphan.
return any errors or warnings in this structure.
Method CloneImageInfo makes a duplicate of the given image info, or if image info is NULL, a new one.
ImageInfo \*CloneImageInfo (const ImageInfo \*image_info)
Method CloneImageInfo returns a duplicate of the given image info, or if image info is NULL a new one.
Specifies a pointer to an ImageInfo structure.
Method CompositeImage returns the second image composited onto the first at the specified offsets.
unsigned int CompositeImage (Image \*image, const CompositeOperator compose, Image \*composite_image, const int x_offset, const int y_offset)
The address of a structure of type Image.
Specifies an image composite operator.
The address of a structure of type Image.
An integer that specifies the column offset of the composited image.
An integer that specifies the row offset of the composited image.
Method CycleColormapImage cycles the image colormap by a specified amount.
CycleColormapImage (image, amount)
The address of a structure of type Image returned from ReadImage.
An unsigned value that specifies the offset of the colormap.
Method DescribeImage describes an image by printing its attributes to stdout.
void DescribeImage (Image \*image, FILE \*file, const unsigned int verbose)
The address of a structure of type Image.
send the image attributes to this file.
an unsigned value other than zero prints detailed information about the image.
Method DestroyImage deallocates memory associated with an image.
void DestroyImage (Image \*image)
The address of a structure of type Image.
Method DestroyImageInfo deallocates memory associated with an ImageInfo structure.
void DestroyImageInfo (ImageInfo \*image_info)
Specifies a pointer to an ImageInfo structure.
Method DestroyImages deallocates memory associated with a linked list of images.
void DestroyImages (Image \*image)
The address of a structure of type Image.
Method DisplayImages displays one or more images to an X window.
unsigned int DisplayImages (const ImageInfo \*image_info, Image \*image)
Method DisplayImages returns True if the images are displayed in an X window, otherwise False is returned.
Specifies a pointer to an ImageInfo structure.
The address of a structure of type Image.
Method GetImageBoundingBox returns the bounding box of an image canvas.
RectangleInfo GetImageBoundingBox (Image \*image)
Method GetImageBoundingBox returns the bounding box of an image canvas.
The address of a structure of type Image.
Method GetImageDepth returns the depth of the image.
unsigned int GetImageDepth (Image \*image)
Method GetImageDepth returns the depth of the image.
The address of a structure of type Image.
Method GetImageInfo initializes the ImageInfo structure.
void GetImageInfo (ImageInfo \*image_info)
Specifies a pointer to an ImageInfo structure.
Method GetImageType returns the type of image (e.g. bilevel, palette, etc).
ImageType GetImageType (Image \*image)
Method GetImageType returns a ImageType enum that specifies the type of the specified image (e.g. bilevel, palette, etc).
The address of a structure of type Image.
Method GetNextImage returns the next image in an image sequence.
Image \*GetNextImage (Image \*image)
Method GetNextImage returns the next image in an image sequence.
The address of a structure of type Image.
Method GetNumberScenes returns the number of scenes in an image sequence.
unsigned int GetNumberScenes (const Image \*image)
Method GetNumberScenes returns the number of scenes in an image sequence.
The address of a structure of type Image.
Method GetPageInfo initializes the image page structure.
void GetPageInfo (RectangleInfo \*page)
Specifies a pointer to a RectangleInfo structure.
Method GetPixelPacket initializes the PixelPacket structure.
void GetPixelPacket (PixelPacket \*pixel)
Specifies a pointer to a PixelPacket structure.
Method IsGeometry returns True if the geometry specification is valid as determined by ParseGeometry.
unsigned int IsGeometry (const char \*geometry)
Method IsGeometry returns True if the geometry specification is valid otherwise False is returned.
This string is the geometry specification.
Method IsImagesEqual measures the difference between two images. The error is computed by summing over all pixels in an image the distance squared in RGB space between each image pixel and its corresponding pixel in the reference image. These values are computed:
This value is the mean error for any single pixel in the image.
This value is the normalized mean quantization error for any single pixel in the image. This distance measure is normalized to a range between 0 and 1. It is independent of the range of red, green, and blue values in the image.
Thsi value is the normalized maximum quantization error for any single pixel in the image. This distance measure is normalized to a range between 0 and 1. It is independent of the range of red, green, and blue values in your image.
unsigned int IsImagesEqual (Image \*image, Image \*reference)
Specifies a pointer to an Image structure.
Specifies a pointer to an Image structure.
Method IsImageTainted returns True if the image has been altered since it was first read or if any image in the sequence has a difference magic or filename.
unsigned int IsImageTainted (const Image \*image)
Method IsImageTainted returns True if the image has been altered since it was first read.
The address of a structure of type Image.
Method IsSubimage returns True if the geometry is a valid subimage specification (e.g. [1], [1-9], [1, 7, 4]).
unsigned int IsSubimage (const char \*geometry, const unsigned int pedantic)
Method IsSubimage returns True if the geometry is a valid subimage specification otherwise False is returned.
This string is the geometry specification.
A value other than 0 invokes a more restriction set of conditions for a valid specification (e.g. [1], [1-4], [4-1]).
Method ListToGroupImage converts a linked list of images to a sequential array.
Image \*\*ListToGroupImage (Image \*image, unsigned int \*number_images)
Method ListToGroupImage converts a linked list of images to a sequential array and returns the array..
The address of a structure of type Image returned from ReadImage.
A pointer to an unsigned integer. The number of images in the image array is returned here.
Method MogrifyImage applies image processing options to an image as prescribed by command line options.
unsigned int MogrifyImage (const ImageInfo \*image_info, const int argc, char \*\*argv, Image \*\*image)
Specifies a pointer to an ImageInfo structure.
Specifies a pointer to an integer describing the number of elements in the argument vector.
Specifies a pointer to a text array containing the command line arguments.
The address of a structure of type Image returned from ReadImage.
Method MogrifyImages applies next processing options to a sequence of images as prescribed by command line options.
unsigned int MogrifyImages (const ImageInfo \*next_info, const int argc, char \*\*argv, Image \*\*image)
Specifies a pointer to an ImageInfo structure.
Specifies a pointer to an integer describing the number of elements in the argument vector.
Specifies a pointer to a text array containing the command line arguments.
The address of a structure of type Image returned from ReadImage.
Method MosaicImages inlays a number of image to form a single coherent picture.
Image \*MosaicImages (const Image \*image, ExceptionInfo \*exception)
The address of a structure of type Image returned from ReadImage.
return any errors or warnings in this structure.
Method ParseImageGeometry parses a geometry specification and returns the width, height, x, and y values. It also returns flags that indicates which of the four values (width, height, xoffset, yoffset) were located in the string, and whether the x and y values are negative. In addition,
int ParseImageGeometry (const char \*geometry, int \*x, int \*y, unsigned int \*width, unsigned int \*height)
Method ParseImageGeometry returns a bitmask that indicates which of the four values were located in the geometry string.
Specifies a character string representing the geometry specification.
A pointer to an integer. The x and y offset as determined by the geometry specification is returned here.
A pointer to an unsigned integer. The width and height as determined by the geometry specification is returned here.
Method RGBTransformImage converts the reference image from RGB to an alternate colorspace. The transformation matrices are not the standard ones: the weights are rescaled to normalized the range of the transformed values to be [0..MaxRGB].
unsigned int RGBTransformImage (Image \*image, const ColorspaceType colorspace)
The address of a structure of type Image returned from ReadImage.
An unsigned integer value that indicates which colorspace to transform the image.
Method SetImage initializes the reference image to the background color.
void SetImage (Image \*image, opacity)
The address of a structure of type Image returned from ReadImage.
The transparency of the background color.
Method SetImageDepth sets the depth of the image.
unsigned int SetImageDepth (Image \*image, const unsigned int)
Method SetImageDepth returns True if the image depth is set.
The address of a structure of type Image.
specified the image depth.
Method SetImageInfo initializes the `magick' field of the ImageInfo structure. It is set to a type of image format based on the prefix or suffix of the filename. For example, `ps:image' returns PS indicating a Postscript image. JPEG is returned for this filename: `image.jpg'. The filename prefix has precendence over the suffix. Use an optional index enclosed in brackets after a file name to specify a desired subimage of a multi-resolution image format like Photo CD (e.g. img0001.pcd[4]).
unsigned int SetImageInfo (ImageInfo \*image_info, const unsigned int rectify)
Specifies a pointer to an ImageInfo structure.
an unsigned value other than zero rectifies the attribute for multi-frame support (user may want multi-frame but image format may not support it).
Method SetImageOpacity initializes the opacity channel of the reference image to the specified value. If the image already has a matte channel it is attenuated with the opacity value.
void SetImageOpacity (Image \*image, const unsigned int opacity)
The address of a structure of type Image returned from ReadImage.
The level of transparency.
Method SetImageType sets the image type.
void SetImageType (Image \*image, const ImageType image_type)
The address of a structure of type Image returned from ReadImage.
image type.
Method SortColormapByIntensity sorts the colormap of a PseudoClass image by decreasing color intensity.
unsigned int SortColormapByIntensity(Image \*image)
A pointer to a Image structure.
Method SyncImage initializes the red, green, and blue intensities of each pixel as defined by the colormap index.
void SyncImage (Image \*image)
The address of a structure of type Image.
Method TextureImage layers a texture onto the background of an image.
void TextureImage (Image \*image, Image \*texture)
The address of a structure of type Image returned from ReadImage.
This image contains the texture to layer on the background.
Method TransformRGBImage converts the reference image from an alternate colorspace. The transformation matrices are not the standard ones: the weights are rescaled to normalize the range of the transformed values to be [0..MaxRGB].
unsigned int TransformRGBImage (Image \*image, const ColorspaceType colorspace)
The address of a structure of type Image returned from ReadImage.
An unsigned integer value defines which colorspace to transform the image to.
Method TransmitImage transmit an image to a variety of destinations. It is used primarily in CGI and ISAPI programs to send an image to a client using either disk, blobs, streaming, or via the normal in memory image structure.
unsigned int TransmitImage (Image \*image, ImageInfo \*image_info, const TransmitType sendmode, void \*param1, void \*param2)
The address of a structure of type Image returned from ReadImage.
Specifies a pointer to an ImageInfo structure.
An unsigned integer value defines which transmit mode to send the image with.
An void pointer whose meaning depends on the transmit mode.
An void pointer whose meaning depends on the transmit mode.
Method MagnifyImage creates a new image that is a integral size greater than an existing one. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
MagnifyImage scans the reference image to create a magnify image by bilinear interpolation. The magnify image columns and rows become:
number_columns << 1 number_rows << 1
magnify_image=MagnifyImage (image, ExceptionInfo \*exception)
Method MagnifyImage returns a pointer to the image after magnification. A null image is returned if there is a memory shortage.
The address of a structure of type Image.
return any errors or warnings in this structure.
Method MinifyImage creates a new image that is a integral size less than an existing one. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
MinifyImage scans the reference image to create a minified image by computing the weighted average of a 4x4 cell centered at each reference pixel. The target pixel requires two columns and two rows of the reference pixels. Therefore the minified image columns and rows become:
number_columns/2 number_rows/2
Weights assume that the importance of neighboring pixels is negately proportional to the square of their distance from the target pixel.
The scan only processes pixels that have a full set of neighbors. Pixels in the top, bottom, left, and right pairs of rows and columns are omitted from the scan.
Image \*MinifyImage (Image \*image, ExceptionInfo \*exception)
Method MinifyImage returns a pointer to the image after reducing. A null image is returned if there is a memory shortage or if the image size is less than IconSize\*2.
The address of a structur of type Image.
return any errors or warnings in this structure.
Method ResizeImage creates a new image that is a scaled size of an existing one. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. The Point filter gives fast pixel replication, Triangle is equivalent to bi-linear interpolation, and Mitchel giver slower, very high-quality results. See Graphic Gems III for details on this algorithm.
Image \*ResizeImage (Image \*image, const unsigned int columns, const unsigned int rows, const FilterType filter, const double blur, ExceptionInfo \*exception)
Method ResizeImage returns a pointer to the image after scaling. A null image is returned if there is a memory shortage.
the address of a structure of type Image.
an integer that specifies the number of columns in the resize image.
an integer that specifies the number of rows in the scaled image.
specifies which image filter to use.
specifies the blur factor where > 1 is blurry, < 1 is sharp.
return any errors or warnings in this structure.
Method SampleImage creates a new image that is a scaled size of an existing one using pixel sampling. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*SampleImage (Image \*image, const unsigned int columns, const unsigned int rows, ExceptionInfo \*exception)
Method SampleImage returns a pointer to the image after scaling. A null image is returned if there is a memory shortage.
The address of a structure of type Image.
An integer that specifies the number of columns in the sampled image.
An integer that specifies the number of rows in the sampled image.
return any errors or warnings in this structure.
Method ScaleImage creates a new image that is a scaled size of an existing one. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. To scale a scanline from x pixels to y pixels, each new pixel represents x/y old pixels. To read x/y pixels, read (x/y rounded up) pixels but only count the required fraction of the last old pixel read in your new pixel. The remainder of the old pixel will be counted in the next new pixel.
The scaling algorithm was suggested by rjohnson@shell.com and is adapted from pnmscale(1) of PBMPLUS by Jef Poskanzer.
Image \*ScaleImage (Image \*image, const unsigned int columns, const unsigned int rows, ExceptionInfo \*exception)
Method ScaleImage returns a pointer to the image after scaling. A null image is returned if there is a memory shortage.
The address of a structure of type Image.
An integer that specifies the number of columns in the scaled image.
An integer that specifies the number of rows in the scaled image.
return any errors or warnings in this structure.
Method ZoomImage creates a new image that is a scaled size of an existing one. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. The Point filter gives fast pixel replication, Triangle is equivalent to bi-linear interpolation, and Mitchel giver slower, very high-quality results. See Graphic Gems III for details on this algorithm.
The filter member of the Image structure specifies which image filter to use. Blur specifies the blur factor where > 1 is blurry, < 1 is sharp.
Image \*ZoomImage (Image \*image, const unsigned int columns, const unsigned int rows, ExceptionInfo \*exception)
Method ZoomImage returns a pointer to the image after scaling. A null image is returned if there is a memory shortage.
The address of a structure of type Image.
An integer that specifies the number of columns in the zoom image.
An integer that specifies the number of rows in the scaled image.
return any errors or warnings in this structure.
Method ChopImage creates a new image that is a subregion of an existing one. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*ChopImage (Image \*image, const RectangleInfo \*chop_info) ExceptionInfo \*exception)
Method ChopImage returns a pointer to the chop image. A null image is returned if there is a memory shortage or if the image width or height is zero.
The address of a structure of type Image.
Specifies a pointer to a RectangleInfo which defines the region of the image to crop.
return any errors or warnings in this structure.
Method CoalesceImages merges a sequence of images. This is useful for GIF and MNG animation sequences that have page offsets and disposal methods.
Image \*CoalesceImages (Image \*image, ExceptionInfo \*exception)
The address of a structure of type Image returned from ReadImage. It points to the first image in the group to be coalesced.
return any errors or warnings in this structure.
Method CropImage creates a new image that is a subregion of an existing one. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. This method is optimized to preserve the runlength encoding. That is, the crop image will always use less memory than the original.
Image \*CropImage (Image \*image, const RectangleInfo \*crop_info, ExceptionInfo \*exception)
Method CropImage returns a pointer to the crop image. A null image is returned if there is a memory shortage or if the image width or height is zero.
The address of a structure of type Image.
Specifies a pointer to a RectangleInfo which defines the region of the image to crop.
return any errors or warnings in this structure.
Method DeconstructImages breaks down an image sequence into constituent parts. This is useful for creating GIF or MNG animation sequences.
Image \*DeconstructImages (Image \*image, ExceptionInfo \*exception)
The address of a structure of type Image returned from ReadImage. It points to the first next in the group to be deconstructed.
return any errors or warnings in this structure.
Method FlipImage creates a new image that reflects each scanline in the vertical direction It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*FlipImage (Image \*image, ExceptionInfo \*exception)
Method FlipImage returns a pointer to the image after reflecting. A null image is returned if there is a memory shortage.
The address of a structure of type Image.
return any errors or warnings in this structure.
Method FlopImage creates a new image that reflects each scanline in the horizontal direction It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*FlopImage (Image \*image, ExceptionInfo \*exception)
Method FlopImage returns a pointer to the image after reflecting. A null image is returned if there is a memory shortage.
The address of a structure of type Image.
return any errors or warnings in this structure.
Method ProfileImage removes or adds a ICM, IPTC, or generic profile to an image. If the profile name is specified it is deleted from the image. If a filename is specified, one or more profiles are read and added to the image.
unsigned int ProfileImage (Image \*image, const char \*profile_name, const char \*filename)
Method ProfileImage returns True if the profile is successfully added or removed from the image, otherwise False.
The address of a structure of type Image.
Specifies the type of profile to add or remove.
Specifies the filename of the ICM or IPTC profile.
Method RollImage rolls an image vertically and horizontally. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*RollImage (Image \*image, const int x_offset, const int y_offset, ExceptionInfo \*exception)
Method RollImage returns a pointer to the image after rolling. A null image is returned if there is a memory shortage.
The address of a structure of type Image.
An integer that specifies the number of columns to roll in the horizontal direction.
An integer that specifies the number of rows to roll in the vertical direction.
return any errors or warnings in this structure.
Method TransformImage creates a new image that is a transformed size of of existing one as specified by the crop and image geometries. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
If a crop geometry is specified a subregion of the image is obtained. If the specified image size, as defined by the image and scale geometries, is smaller than the actual image size, the image is first minified to an integral of the specified image size with an antialias digital filter. The image is then scaled to the exact specified image size with pixel replication. If the specified image size is greater than the actual image size, the image is first enlarged to an integral of the specified image size with bilinear interpolation. The image is then scaled to the exact specified image size with pixel replication.
void TransformImage (Image \*\*image, const char \*crop_geometry, const char \*image_geometry)
The address of an address of a structure of type Image. The transformed image is returned as this parameter.
Specifies a pointer to a crop geometry string. This geometry defines a subregion of the image.
Specifies a pointer to a image geometry string. The specified width and height of this geometry string are absolute.
Method CloneDrawInfo makes a duplicate of the given draw info, or if draw info is NULL, a new one.
DrawInfo \*CloneDrawInfo (const ImageInfo \*image_info, const DrawInfo \*draw_info)
Method CloneDrawInfo returns a duplicate of the given annotate info, or if annotate info is NULL a new one.
a structure of type ImageInfo.
a structure of type DrawInfo.
Method ColorFloodfillImage floodfills the designated area with a color. The floodfill algorithm is strongly based on a similar algorithm in "Graphics Gems" by Paul Heckbert.
unsigned int ColorFloodfillImage (Image \*image, const DrawInfo \*draw_info, const PixelPacket target, const int x_offset, const int y_offset, const PaintMethod method)
The address of a structure of type Image.
a structure of type DrawInfo.
A PixelPacket structure. This is the RGB value of the target color.
Unsigned integers representing the current location of the pen.
drawing method of type PrimitiveType: floodfill or fill to border.
Method DestroyDrawInfo deallocates memory associated with an DrawInfo structure.
void DestroyDrawInfo (DrawInfo \*draw_info)
Specifies a pointer to an DrawInfo structure.
Method DrawImage draws a primitive (line, rectangle, ellipse) on the image.
unsigned int DrawImage (Image \*image, const DrawInfo \*draw_info)
The address of a structure of type Image.
The address of a DrawInfo structure.
Method GetDrawInfo initializes the DrawInfo structure.
void GetDrawInfo (const ImageInfo \*image_info, DrawInfo \*draw_info)
Specifies a pointer to an ImageInfo structure.
Specifies a pointer to a DrawInfo structure.
Method MatteFloodfillImage floodfills the designated area with a matte value. The floodfill algorithm is strongly based on a similar algorithm in "Graphics Gems" by Paul Heckbert.
unsigned int MatteFloodfillImage (Image \*image, const PixelPacket target, const unsigned int matte, const int x_offset, const int y_offset, const PaintMethod method)
The address of a structure of type Image.
A PixelPacket structure. This is the RGB value of the target color.
A integer value representing the amount of transparency.
Unsigned integers representing the current location of the pen.
drawing method of type PrimitiveType: floodfill or fill to border.
Method OpaqueImage changes the color of an opaque point to the pen color.
unsigned int OpaqueImage (Image \*image, const PixelPacket target, const PixelPacket pen_color)
The address of a structure of type Image returned from ReadImage.
the color to search for in the image.
the color to replace it with.
Method TransparentImage creates a matte image associated with the image. All pixel locations are initially set to opaque. Any pixel that matches the specified color are set to transparent.
unsigned int TransparentImage (Image \*image, const PixelPacket target)
The address of a structure of type Image returned from ReadImage.
The color to search for in the image.
Method AnnotateImage annotates an image with text. Optionally the annotation can include the image filename, type, width, height, or scene
unsigned int AnnotateImage (Image \*image, DrawInfo \*draw_info)
Method AnnotateImage returns True if the image is annotated otherwise False.
The address of a structure of type Image.
The address of a DrawInfo structure.
Method GetFontMetrics returns the following information for the specified font and text:
character width, expressed in integer pixels o character height, expressed in integer pixels o ascent, expressed in 26.6 fixed point pixels o descent, expressed in 26.6 fixed point pixels o text width, expressed in 26.6 fixed point pixels o text height, expressed in 26.6 fixed point pixels o maximum horizontal advance, expressed in 26.6 fixed point pixels
unsigned int GetFontMetrics (Image \*image, const DrawInfo \*draw_info, FontMetric metrics)
Method GetFontMetrics returns True if the metrics are available otherwise False.
The address of a structure of type Image.
Specifies a pointer to a DrawInfo structure.
Method GetFontMetrics returns the font metrics.
Method CompressColormap compresses an image colormap removing any duplicate and unused color entries.
void CompressColormap (Image \*image)
The address of a structure of type Image.
Method GetNumberColors returns the number of unique colors in an image.
number_colors=GetNumberColors (image, file)
Method GetNumberColors returns the number of unique colors in the specified image.
The address of a byte (8 bits) array of run-length encoded pixel data of your source image. The sum of the run-length counts in the source image must be equal to or exceed the number of pixels.
An pointer to a FILE. If it is non-null a list of unique pixel field values and the number of times each occurs in the image is written to the file.
Method IsGrayImage returns True if the image is grayscale otherwise False is returned. If the image is DirectClass and grayscale, it is demoted to PseudoClass.
unsigned int IsGrayImage (Image \*image)
Method IsGrayImage returns True if the image is grayscale otherwise False is returned.
The address of a structure of type Image returned from ReadImage.
Method IsMonochromeImage returns True if the image is monochrome otherwise False is returned. If the image is DirectClass and grayscale (including monochrome), it is demoted to PseudoClass.
status=IsMonochromeImage (image)
Method IsMonochromeImage returns True if the image is monochrome otherwise False is returned.
The address of a structure of type Image returned from ReadImage.
Method IsOpaqueImage returns False if the image has one or more pixels that are transparent otherwise True is returned.
unsigned int IsOpaqueImage (Image \*image)
Method IsOpaqueImage returns False if the image has one or more pixels that are transparent otherwise True is returned.
The address of a structure of type Image returned from ReadImage.
Method IsPseudoClass returns True if the image is PseudoClass and has 256 unique colors or less. If the image is DirectClass and has 256 colors or less, the image is demoted to PseudoClass.
unsigned int IsPseudoClass (Image \*image)
Method IsPseudoClass returns True is the image is PseudoClass or has 256 color or less.
The address of a structure of type Image.
Method ListColors reads the X client color database and returns a list of colors contained in the database sorted in ascending alphabetic order.
filelist=ListColors (pattern, number_colors)
Method ListColors returns a list of colors contained in the database. If the database cannot be read, a NULL list is returned.
Specifies a pointer to a text string containing a pattern.
This integer returns the number of colors in the list.
Method QueryColorDatabase looks up a RGB values for a color given in the target string.
unsigned int QueryColorDatabase (const char \*target, PixelPacket \*color)
Method QueryColorDatabase returns True if the RGB values of the target color is defined, otherwise False is returned.
Specifies the color to lookup in the X color database.
A pointer to an PixelPacket structure. The RGB value of the target color is returned as this value.
Method QueryColorName returns the name of the color that is closest to the supplied color in RGB space.
unsigned int QueryColorName (const PixelPacket \*color, char \*name)
Method QueryColorName returns the distance-squared in RGB space as well as the color name that is at a minimum distance.
This is a pointer to a PixelPacket structure that contains the color we are searching for.
The name of the color that is closest to the supplied color is returned in this character buffer.
Method BorderImage takes an image and puts a border around it of a particular color. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*BorderImage (const Image \*image, const RectangleInfo \*border_info, ExceptionInfo \*exception)
Method BorderImage returns a pointer to the border image. A null image is returned if there is a memory shortage.
The address of a structure of type Image.
Specifies a pointer to a structure of type Rectangle which defines the border region.
return any errors or warnings in this structure.
Method FrameImage takes an image and puts a frame around it of a particular color. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*FrameImage (Image \*image, const FrameInfo \*frame_info, ExceptionInfo \*exception)
Method FrameImage returns a pointer to the framed image. A null image is returned if there is a memory shortage.
The address of a structure of type Image.
Specifies a pointer to a FrameInfo structure which defines the framed region.
return any errors or warnings in this structure.
Method RaiseImage lightens and darkens the edges of an image to give a 3-D raised or lower effect.
unsigned int RaiseImage (Image \*image, const RectangleInfo \*raise_info, const int raised)
The address of a structure of type Image.
Specifies a pointer to a XRectangle which defines the raised region.
A value other than zero causes the image to have a 3-D raised effect, otherwise it has a lowered effect.
Method CloneMontageInfo makes a duplicate of the given montage info, or if montage info is NULL, a new one.
MontageInfo \*CloneMontageInfo (const ImageInfo \*image_info, const MontageInfo \*montage_info)
Method CloneMontageInfo returns a duplicate of the given annotate info, or if annotate info is NULL a new one.
a structure of type ImageInfo.
a structure of type MontageInfo.
Method DestroyMontageInfo deallocates memory associated with an MontageInfo structure.
void DestroyMontageInfo (MontageInfo \*montage_info)
Specifies a pointer to an MontageInfo structure.
Method GetMontageInfo initializes the MontageInfo structure.
void GetMontageInfo (const ImageInfo \*image_info, MontageInfo \*montage_info)
a structure of type ImageInfo.
Specifies a pointer to a MontageInfo structure.
Method MontageImages creates a composite image by combining several separate images.
Image \*MontageImages (Image \*image, const MontageInfo \*montage_info, ExceptionInfo \*exception)
Specifies a pointer to an array of Image structures.
Specifies a pointer to a MontageInfo structure.
return any errors or warnings in this structure.
Method AddNoiseImage creates a new image that is a copy of an existing one with noise added. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*AddNoiseImage (Image \*image, const NoiseType noise_type, ExceptionInfo \*exception)
Method AddNoiseImage returns a pointer to the image after the noise is minified. A null image is returned if there is a memory shortage.
The address of a structure of type Image returned from ReadImage.
The type of noise: Gaussian, multiplicative Gaussian, impulse, laplacian, or Poisson.
return any errors or warnings in this structure.
Method BlurImage creates a blurred copy of the input image. We convolve the image with a Gaussian operator of the given width and standard deviation (sigma).
Each output pixel is set to a value that is the weighted average of the input pixels in an area enclosing the pixel. The width parameter determines how large the area is. Each pixel in the area is weighted in the average according to its distance from the center, and the standard deviation, sigma. The actual weight is calculated according to the Gaussian distribution (also called normal distribution), which looks like a Bell Curve centered on a pixel. The standard deviation controls how 'pointy' the curve is. The pixels near the center of the curve (closer to the center of the area we are averaging) contribute more than the distant pixels.
In general, the width should be wide enough to include most of the total weight under the Gaussian for the standard deviation you choose. the width parameter to the method specifies the radius of the Gaussian convolution mask in pixels, not counting the centre pixel, the width parameter should be chosen larger than the standard deviation, perhaps about twice as large to three times as large. A width of 1 will give a (standard) 3x3 convolution mask, a width of 2 gives a 5 by 5 convolution mask. Using non-integral widths will result in some pixels being considered 'partial' pixels, in which case their weight will be reduced proportionally.
Pixels for which the convolution mask does not completely fit on the image (e.g. pixels without a full set of neighbours) are averaged with those neighbours they do have. Thus pixels at the edge of images are typically less blur.
Since a 2d Gaussian is seperable, we perform the Gaussian blur by convolving with two 1d Gaussians, first in the x, then in the y direction. For an n by n image and Gaussian width w this requires 22 multiplications, while convolving with a 2d Gaussian requres w2n2 mults.
We blur the image into a copy, and the original is left untouched. We must process the image in two passes, in each pass we change the pixel based on its neighbors, but we need the pixel's original value for the next pixel's calculation. For the first pass we could use the original image but that's no good for the second pass, and it would imply that the original image have to stay around in ram. Instead we use a small (size=width) buffer to store the pixels we have overwritten.
This method was contributed by runger@cs.mcgill.ca.
Image \*BlurImage (Image \*image, const double radius, const double sigma, ExceptionInfo \*exception)
Method BlurImage returns a pointer to the image after it is blur. A null image is returned if there is a memory shortage.
The radius of the Gaussian, in pixels, not counting the center pixel.
The standard deviation of the Gaussian, in pixels.
return any errors or warnings in this structure.
Method ColorizeImage creates a new image that is a copy of an existing one with the image pixels colorized. The colorization is controlled with the pen color and the opacity levels.
Image \*ColorizeImage (Image \*image, const char \*opacity, const PixelPacket target, ExceptionInfo \*exception)
The address of a structure of type Image returned from ReadImage.
A character string indicating the level of opacity as a percentage (0-0.5).
A color value.
return any errors or warnings in this structure.
Method ConvolveImage applies a general image convolution kernel to an image returns the results. ConvolveImage allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*ConvolveImage (Image \*image, const unsigned int order, const double \*kernel, ExceptionInfo \*exception)
Method ConvolveImage returns a pointer to the image after it is convolved. A null image is returned if there is a memory shortage.
The address of a structure of type Image returned from ReadImage.
The number of columns and rows in the filter kernel.
An array of double representing the convolution kernel.
return any errors or warnings in this structure.
Method DespeckleImage creates a new image that is a copy of an existing one with the speckle noise minified. It uses the eight hull algorithm described in Applied Optics, Vol. 24, No. 10, 15 May 1985, "Geometric filter for Speckle Reduction", by Thomas R Crimmins. Each pixel in the image is replaced by one of its eight of its surrounding pixels using a polarity and negative hull function. DespeckleImage allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*DespeckleImage (Image \*image, ExceptionInfo \*exception)
Method DespeckleImage returns a pointer to the image after it is despeckled. A null image is returned if there is a memory shortage.
The address of a structure of type Image returned from ReadImage.
return any errors or warnings in this structure.
Method EdgeImage creates a new image that is a copy of an existing one with the edges enhanced. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*EdgeImage (Image \*image, const double radius, ExceptionInfo \*exception)
Method EdgeImage returns a pointer to the image after it is edge. A null image is returned if there is a memory shortage.
the address of a structure of type Image returned from ReadImage.
the radius of the pixel neighborhood.
return any errors or warnings in this structure.
Method EmbossImage creates a new image that is a copy of an existing one with the edge highlighted. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*EmbossImage (Image \*image, const double radius, const double sigma, ExceptionInfo \*exception)
Method EmbossImage returns a pointer to the image after it is embossed. A null image is returned if there is a memory shortage.
The address of a structure of type Image returned from ReadImage.
the radius of the pixel neighborhood.
The standard deviation of the Gaussian, in pixels.
return any errors or warnings in this structure.
Method EnhanceImage creates a new image that is a copy of an existing one with the noise minified. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
EnhanceImage does a weighted average of pixels in a 5x5 cell around each target pixel. Only pixels in the 5x5 cell that are within a RGB distance threshold of the target pixel are averaged.
Weights assume that the importance of neighboring pixels is negately proportional to the square of their distance from the target pixel.
The scan only processes pixels that have a full set of neighbors. Pixels in the top, bottom, left, and right pairs of rows and columns are omitted from the scan.
Image \*EnhanceImage (Image \*image, ExceptionInfo \*exception)
Method EnhanceImage returns a pointer to the image after it is enhanced. A null image is returned if there is a memory shortage.
The address of a structure of type Image returned from ReadImage.
return any errors or warnings in this structure.
Method GaussianBlurImage creates a new image that is a copy of an existing one with the pixels blur. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*GaussianBlurImage (Image \*image, const double radius, const double sigma, ExceptionInfo \*exception)
Method GaussianBlurImage returns a pointer to the image after it is blur. A null image is returned if there is a memory shortage.
the radius of the Gaussian, in pixels, not counting the center pixel.
the standard deviation of the Gaussian, in pixels.
return any errors or warnings in this structure.
Method ImplodeImage creates a new image that is a copy of an existing one with the image pixels ïmplode" by the specified percentage. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*ImplodeImage (Image \*image, const double factor, ExceptionInfo \*exception)
Method ImplodeImage returns a pointer to the image after it is implode. A null image is returned if there is a memory shortage.
The address of a structure of type Image returned from ReadImage.
A double value that defines the extent of the implosion.
return any errors or warnings in this structure.
Method MedianFilterImage creates a new image that is a copy of an existing one with each pixel component replaced with the median color in a pixel neighborhood.
Image \*MedianFilterImage (Image \*image, const double radius, ExceptionInfo \*exception)
Method MedianFilterImage returns a pointer to the image after it is `filtered'. A null image is returned if there is a memory shortage.
the address of a structure of type Image returned from ReadImage.
the radius of the pixel neighborhood.
return any errors or warnings in this structure.
Method MorphImages morphs a sequence of images. Both the next pixels and size are linearly interpolated to give the appearance of a meta-morphosis from one next to the next.
Image \*MorphImages (Image \*image, const unsigned int number_frames, ExceptionInfo \*exception)
Method MorphImages returns an next sequence that has linearly interpolated pixels and size between two input image.
The address of a structure of type Image returned from ReadImage.
This unsigned integer reflects the number of in-between image to generate. The more in-between frames, the smoother the morph.
return any errors or warnings in this structure.
Method OilPaintImage creates a new image that is a copy of an existing one with each pixel component replaced with the color of greatest frequency in a circular neighborhood.
Image \*OilPaintImage (Image \*image, const double radius, ExceptionInfo \*exception)
Method OilPaintImage returns a pointer to the image after it is `painted'. A null image is returned if there is a memory shortage.
The address of a structure of type Image returned from ReadImage.
The radius of the circular neighborhood.
return any errors or warnings in this structure.
Method PlasmaImage initializes an image with plasma fractal values. The image must be initialized with a base color and the random number generator seeded before this method is called.
unsigned int PlasmaImage (Image \*image, const SegmentInfo \*segment, int attenuate, int depth)
Method PlasmaImage returns True when the fractal process is complete. Otherwise False is returned.
The address of a structure of type Image returned from ReadImage.
specifies a structure of type SegmentInfo that defines the boundaries of the area where the plasma fractals are applied.
specifies the plasma attenuation factor.
this integer values define the plasma recursion depth.
Method ReduceNoiseImage creates a new image that is a copy of an existing one with the noise minified with a noise peak elimination filter. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
The principal function of noise peak elimination filter is to smooth the objects within an image without losing edge information and without creating undesired structures. The central idea of the algorithm is to replace a pixel with its next neighbor in value within a window, if this pixel has been found to be noise. A pixel is defined as noise if and only if this pixel is a maximum or minimum within the window.
Image \*ReduceNoiseImage (Image \*image, const double, ExceptionInfo \*exception)
Method ReduceNoiseImage returns a pointer to the image after the noise is minified. A null image is returned if there is a memory shortage.
the address of a structure of type Image returned from ReadImage.
the radius of the pixel neighborhood.
return any errors or warnings in this structure.
Method ShadeImage creates a new image that is a copy of an existing one with the image pixels shaded using a distance light source. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*ShadeImage (Image \*image, const unsigned int color_shading, double azimuth, double elevation, ExceptionInfo \*exception)
Method ShadeImage returns a pointer to the image after it is shaded. A null image is returned if there is a memory shortage.
The address of a structure of type Image returned from ReadImage.
A value other than zero shades the red, green, and blue components of the image.
A double value that indicates the light source direction.
return any errors or warnings in this structure.
Method SharpenImage creates a new image that is sharpened version of the original image using a Laplacian convolution kernel.
Image \*SharpenImage (Image \*image, const double radius, const double sigma, ExceptionInfo \*exception)
Method SharpenImage returns a pointer to the image after it is sharp. A null image is returned if there is a memory shortage.
The radius of the Gaussian, in pixels, not counting the center pixel.
The standard deviation of the Laplacian, in pixels.
return any errors or warnings in this structure.
Method SolarizeImage produces a 'solarization' effect seen when exposing a photographic film to light during the development process.
void SolarizeImage (Image \*image, const double factor)
The address of a structure of type Image returned from ReadImage.
An double value that defines the extent of the solarization.
Method SpreadImage creates a new image that is a copy of an existing one with the image pixels randomly displaced. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*SpreadImage (Image \*image, const unsigned int amount, ExceptionInfo \*exception)
Method SpreadImage returns a pointer to the image after it is spread. A null image is returned if there is a memory shortage.
The address of a structure of type Image returned from ReadImage.
An unsigned value constraining the "vicinity" for choosing a random pixel to swap.
return any errors or warnings in this structure.
Method SteganoImage hides a digital watermark within the image.
Image \*SteganoImage (Image \*image, Image \*watermark, ExceptionInfo \*exception)
Method SteganoImage returns a pointer to the steganographic image with the watermark hidden. A null image is returned if there is a memory shortage.
The address of a structure of type Image.
The address of a structure of type Image.
return any errors or warnings in this structure.
Method StereoImage combines two images and produces a single image that is the composite of a left and right image of a stereo pair. The left image is converted to gray scale and written to the red channel of the stereo image. The right image is converted to gray scale and written to the blue channel of the stereo image. View the composite image with red-blue glasses to create a stereo effect.
Image \*StereoImage (Image \*image, Image \*offset_image, ExceptionInfo \*exception)
Method StereoImage returns a pointer to the stereo image. A null image is returned if there is a memory shortage.
The address of a structure of type Image.
The address of a structure of type Image.
return any errors or warnings in this structure.
Method SwirlImage creates a new image that is a copy of an existing one with the image pixels ßwirl" at a specified angle. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*SwirlImage (Image \*image, double degrees, ExceptionInfo \*exception)
Method SwirlImage returns a pointer to the image after it is swirl. A null image is returned if there is a memory shortage.
The address of a structure of type Image returned from ReadImage.
An double value that defines the tightness of the swirling.
return any errors or warnings in this structure.
Method ThresholdImage thresholds the reference image.
unsigned int ThresholdImage (Image \*image, const double threshold)
The address of a structure of type Image returned from ReadImage.
A double indicating the threshold value.
Method UnsharpMaskImage creates a new image that is sharpened version of the original image using the unsharp mask algorithm.
Image \*UnsharpMaskImage (Image \*image, const double radius, const double sigma, const double amount, const double threshold, ExceptionInfo \*exception)
Method UnsharpMaskImage returns a pointer to the image after it is blur. A null image is returned if there is a memory shortage.
The radius of the Gaussian, in pixels, not counting the center pixel.
The standard deviation of the Gaussian, in pixels.
The percentage of the difference between the original and the blur image that is added back into the original.
The threshold in pixels needed to apply the diffence amount.
return any errors or warnings in this structure.
Method WaveImage creates a new image that is a copy of an existing one with the image pixels altered along a sine wave. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*WaveImage (Image \*image, const double amplitude, const double wave_length, ExceptionInfo \*exception)
Method WaveImage returns a pointer to the image after it is waved. A null image is returned if there is a memory shortage.
The address of a structure of type Image returned from ReadImage.
A double value that indicates the amplitude and wave_length of the sine wave.
return any errors or warnings in this structure.
Method ContrastImage enhances the intensity differences between the lighter and darker elements of the image.
unsigned int ContrastImage (Image \*image, const unsigned int sharpen)
The address of a structure of type Image returned from ReadImage.
If True, the intensity is increased otherwise it is decreased.
Method EqualizeImage performs histogram equalization on the reference image.
unsigned int EqualizeImage (Image \*image)
The address of a structure of type Image returned from ReadImage.
Method GammaImage converts the reference image to gamma corrected colors.
unsigned int GammaImage (Image \*image, const char \*gamma)
The address of a structure of type Image returned from ReadImage.
A character string indicating the level of gamma correction.
Method ModulateImage modulates the hue, saturation, and brightness of an image.
unsigned int ModulateImage (Image \*image, const char \*modulate)
The address of a structure of type Image returned from ReadImage.
A character string indicating the percent change in brightness, saturation, and hue in floating point notation separated by commas (e.g. 110.1, 100.0, 83.1).
Method MotionBlurImage creates a new image that is a copy of an existing one with the pixels blur. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Image \*MotionBlurImage (Image \*image, const double radius, const double sigma, ExceptionInfo \*exception)
Method MotionBlurImage returns a pointer to the image after it is blur. A null image is returned if there is a memory shortage.
the radius of the Motion, in pixels, not counting the center pixel.
the standard deviation of the Motion, in pixels.
return any errors or warnings in this structure.
Method NegateImage negates the colors in the reference image. The Grayscale option means that only grayscale values within the image are negated.
unsigned int NegateImage (Image \*image, const unsigned int grayscale)
The address of a structure of type Image returned from ReadImage.
Method NormalizeImage normalizes the pixel values to span the full range of color values. This is a contrast enhancement technique.
unsigned int NormalizeImage (Image \*image)
The address of a structure of type Image returned from ReadImage.
Method CloneQuantizeInfo makes a duplicate of the given quantize info structure, or if quantize info is NULL, a new one.
QuantizeInfo \*CloneQuantizeInfo (const QuantizeInfo \*quantize_info)
Method CloneQuantizeInfo returns a duplicate of the given quantize info, or if image info is NULL a new one.
a structure of type info.
Method DestroyQuantizeInfo deallocates memory associated with an QuantizeInfo structure.
DestroyQuantizeInfo (QuantizeInfo \*quantize_info)
Specifies a pointer to an QuantizeInfo structure.
Method GetQuantizeInfo initializes the QuantizeInfo structure.
GetQuantizeInfo (QuantizeInfo \*quantize_info)
Specifies a pointer to a QuantizeInfo structure.
MapImage replaces the colors of an image with the closest color from a reference image.
unsigned int MapImage (Image \*image, Image \*map_image, const unsigned int dither)
Specifies a pointer to an Image structure.
Specifies a pointer to a Image structure. Reduce image to a set of colors represented by this image.
Set this integer value to something other than zero to dither the quantized image.
MapImages replaces the colors of a sequence of images with the closest color from a reference image.
unsigned int MapImages (Image \*images, Image \*map_image, const unsigned int dither)
Specifies a pointer to a set of Image structures.
Specifies a pointer to a Image structure. Reduce image to a set of colors represented by this image.
Set this integer value to something other than zero to dither the quantized image.
Method QuantizationError measures the difference between the original and quantized images. This difference is the total quantization error. The error is computed by summing over all pixels in an image the distance squared in RGB space between each reference pixel value and its quantized value. These values are computed:
This value is the mean error for any single pixel in the image.
This value is the normalized mean quantization error for any single pixel in the image. This distance measure is normalized to a range between 0 and 1. It is independent of the range of red, green, and blue values in the image.
Thsi value is the normalized maximum quantization error for any single pixel in the image. This distance measure is normalized to a range between 0 and 1. It is independent of the range of red, green, and blue values in your image.
unsigned int QuantizationError (Image \*image)
Specifies a pointer to an Image structure returned from ReadImage.
Method QuantizeImage analyzes the colors within a reference image and chooses a fixed number of colors to represent the image. The goal of the algorithm is to minimize the difference between the input and output image while minimizing the processing time.
unsigned int QuantizeImage (const QuantizeInfo \*quantize_info, Image \*image)
Specifies a pointer to an QuantizeInfo structure.
Specifies a pointer to a Image structure.
QuantizeImages analyzes the colors within a set of reference images and chooses a fixed number of colors to represent the set. The goal of the algorithm is to minimize the difference between the input and output images while minimizing the processing time.
unsigned int QuantizeImages (const QuantizeInfo \*quantize_info, Image \*images)
Specifies a pointer to an QuantizeInfo structure.
Specifies a pointer to a list of Image structures.
Method SegmentImage segment an image by analyzing the histograms of the color components and identifying units that are homogeneous with the fuzzy c-means technique.
Specify cluster threshold as the number of pixels in each cluster must exceed the the cluster threshold to be considered valid. Smoothing threshold 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.
unsigned int SegmentImage (Image \*image, const ColorspaceType colorspace, const unsigned int verbose, const double cluster_threshold, const double smoothing_threshold)
The SegmentImage function returns this integer value. It is the actual number of colors allocated in the colormap.
Specifies a pointer to an Image structure returned from ReadImage.
An unsigned integer value that indicates the colorspace. Empirical evidence suggests that distances in YUV or YIQ correspond to perceptual color differences more closely than do distances in RGB space. The image is then returned to RGB colorspace after color reduction.
A value greater than zero prints detailed information about the identified classes.
Method RotateImage creates a new image that is a rotated copy of an existing one. Positive angles rotate counter-clockwise (right-hand rule), while negative angles rotate clockwise. Rotated images are usually larger than the originals and have 'empty' triangular corners. X axis. Empty triangles left over from shearing the image are filled with the color defined by the pixel at location (0, 0). RotateImage allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Method RotateImage is based on the paper Ä Fast Algorithm for General Raster Rotatation" by Alan W. Paeth. RotateImage is adapted from a similar method based on the Paeth paper written by Michael Halle of the Spatial Imaging Group, MIT Media Lab.
Image \*RotateImage (Image \*image, const double degrees, ExceptionInfo \*exception)
Method RotateImage returns a pointer to the image after rotating. A null image is returned if there is a memory shortage.
The address of a structure of type Image returned from ReadImage.
Specifies the number of degrees to rotate the image.
return any errors or warnings in this structure.
Method ShearImage creates a new image that is a shear_image copy of an existing one. 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 along the Y axis. The amount of the shear is controlled by a shear angle. For X direction shears, x_shear is measured relative to the Y axis, and similarly, for Y direction shears y_shear is measured relative to the X axis. Empty triangles left over from shearing the image are filled with the color defined by the pixel at location (0, 0). ShearImage allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Method ShearImage is based on the paper Ä Fast Algorithm for General Raster Rotatation" by Alan W. Paeth.
Image \*ShearImage (Image \*image, const double x_shear, const double y_shear, ExceptionInfo \*exception)
Method ShearImage returns a pointer to the image after rotating. A null image is returned if there is a memory shortage.
The address of a structure of type Image returned from ReadImage.
Specifies the number of degrees to shear the image.
return any errors or warnings in this structure.
Method SignatureImage computes a digital signature from an image. This signature uniquely identifies the image and is convenient for determining if the colormap of a sequence of images is identical when animating. The digital signature is from RSA Data Security MD5 Digest Algorithm described in Internet draft [MD5], July 1992, computed on the pixels after expanding them to 64-bit RGBA representation, with the two bytes of each 16-bit sample ordered most significant byte first. The signature is in RGBA or CMYK order depending on the colorspace of the image. If the image does not have any alpha information, an opaque value (65535) is used.
unsigned int SignatureImage (Image \*image)
The address of a structure of type Image.
Method ReadStream makes the image pixels available to a user supplied callback method immediately upon reading a scanline with the ReadImage() method.
unsigned int ReadStream (const ImageInfo \*image_info, void (\*Stream) (const Image \*, const void \*, const size_t), ExceptionInfo \*exception)
Method ReadStream returns True if the image pixels are streamed to the user supplied callback method otherwise False.
Specifies a pointer to an ImageInfo structure.
a callback method.
return any errors or warnings in this structure.
Method WriteStream makes the image pixels available to a user supplied callback method immediately upon writing pixel data with the WriteImage() method.
unsigned int WriteStream (const ImageInfo \*image_info, Image \*, int (\*Stream) (const Image \*, const void \*, const size_t))
Method WriteStream returns True if the image pixels are streamed to the user supplied callback method otherwise False.
Specifies a pointer to an ImageInfo structure.
a callback method.
Method DestroyImageAttributes deallocates memory associated with the image attribute list.
DestroyImageAttributes (Image \*image)
The address of a structure of type Image.
Method GetImageAttribute searches the list of image attributes and returns a pointer to attribute if it exists otherwise NULL.
ImageAttribute \*GetImageAttribute (const Image \*image, const char \*key)
Method GetImageAttribute returns the attribute if it exists otherwise NULL.
The address of a structure of type Image.
These character strings are the name of an image attribute to return.
Method GetImageInfoAttribute returns a "fake" attribute based on data in the image info or image structures.
ImageAttribute \*GetImageAttribute(const Image \*image, const char \*key)
Method GetImageInfoAttribute returns the attribute if it exists otherwise NULL.
The address of a structure of type ImageInfo.
The address of a structure of type Image.
These character strings are the name of an image attribute to return.
Method SetImageAttribute searches the list of image attributes and replaces the attribute value. If it is not found in the list, the attribute name and value is added to the list. If the attribute exists in the list, the value is concatenated to the attribute. SetImageAttribute returns True if the attribute is successfully concatenated or added to the list, otherwise False. If the value is NULL, the matching key is deleted from the list.
unsigned int SetImageAttribute (Image \*image, const char \*key, const char \*value)
Method SetImageAttribute returns True if the attribute is successfully replaced or added to the list, otherwise False.
The address of a structure of type Image.
These character strings are the name and value of an image attribute to replace or add to the list.
Method StoreImageAttribute is used to store an image attribute from a text string with the syntax: NAME=VALUE.
StoreImageAttribute (Image \*image, char \*text)
The address of a structure of type Image.
The text string that is parsed and used to determine the name and value of the new attribute.
Method ClosePixelCache closes the pixel cache. Use this method to prevent the too many file descriptors from being allocated when reading an image sequence. File descriptors are only used for a disk-based cache. This is essentially a no-op for a memory-based cache.
void ClosePixelCache (Image \*image)
The address of a structure of type Image.
Method DestroyPixelCache deallocates memory associated with the pixel cache.
void DestroyPixelCache (Image \*image)
The address of a structure of type Image.
Method GetIndexesFromCache returns the colormap indexes associated with the last call to the SetPixelCache() or GetPixelCache() methods.
IndexPacket \*GetIndexesFromCache (const Image \*image)
Method GetIndexesFromCache returns the colormap indexes associated with the last call to the SetPixelCache() or GetPixelCache() methods.
The address of a structure of type Image.
Method GetOnePixelFromCache returns a single pixel at the specified (x, y) location. The image background color is returned if an error occurs.
PixelPacket \*GetOnePixelFromCache (const Image image, const int x, const int y)
Method GetOnePixelFromCache returns a pixel at the specified (x, y) location.
The address of a structure of type Image.
These values define the location of the pixel to return.
Method GetPixelCache gets pixels from the in-memory or disk pixel cache as defined by the geometry parameters. A pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.
PixelPacket \*GetPixelCache (Image \*image, const int x, const int y, const unsigned int columns, const unsigned int rows)
Method GetPixelCache returns a pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.
The address of a structure of type Image.
These values define the perimeter of a region of pixels.
Method GetPixelsFromCache returns the pixels associated with the last call to the SetPixelCache() or GetPixelCache() methods.
PixelPacket \*GetPixelsFromCache (const Image image)
Method GetPixelsFromCache returns the pixels associated with the last call to the SetPixelCache() or GetPixelCache() methods.
The address of a structure of type Image.
Method SetPixelCache allocates an area to store image pixels as defined by the region rectangle and returns a pointer to the area. This area is subsequently transferred from the pixel cache with method SyncPixelCache. A pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.
PixelPacket \*SetPixelCache (Image \*image, const int x, const int y, const unsigned int columns, const unsigned int rows)
Method SetPixelCache returns a pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.
The address of a structure of type Image.
These values define the perimeter of a region of pixels.
Method SyncPixelCache saves the image pixels to the in-memory or disk cache. The method returns True if the pixel region is synced, otherwise False.
unsigned int SyncPixelCache (Image \*image)
Method SyncPixelCache returns True if the image pixels are transferred to the in-memory or disk cache otherwise False.
The address of a structure of type Image.
Method WriteCacheInfo writes the persistent cache meta information to a file on disk.
unsigned int WriteCacheInfo (Image \*image)
Method WriteCacheInfo returns True if the cache meta information is written to the specified file, otherwise False.
The address of a structure of type Image.
Method BlobToImage implements direct to memory image formats. It returns the blob as an image.
Image \*BlobToImage (const ImageInfo \*image_info, const void \*blob, const size_t length, ExceptionInfo \*exception)
Method BlobToImage returns an image from the supplied blob. If an error occurs NULL is returned.
Specifies a pointer to an ImageInfo structure.
The address of a character stream in one of the image formats understood by ImageMagick.
This size_t integer reflects the length in bytes of the blob.
return any errors or warnings in this structure.
Method DestroyBlobInfo deallocates memory associated with an BlobInfo structure.
void DestroyBlobInfo (BlobInfo \*blob)
Specifies a pointer to a BlobInfo structure.
Method GetBlobInfo initializes the BlobInfo structure.
void GetBlobInfo (BlobInfo \*blob)
Specifies a pointer to a BlobInfo structure.
Method ImageToBlob implements direct to memory image formats. It returns the image as a blob and its length. The magick member of the Image structure determines the format of the returned blob (GIG, JPEG, PNG, etc.).
void \*ImageToBlob (const ImageInfo \*image_info, Image \*image, size_t \*length, ExceptionInfo \*exception)
Method ImageToBlob returns a chunk of memory written in the desired image format (e.g. JPEG, GIF, etc.). If an error occurs NULL is returned.
Specifies a pointer to an ImageInfo structure.
The address of a structure of type Image.
This pointer to a size_t integer sets the initial length of the blob. On return, it reflects the actual length of the blob.
return any errors or warnings in this structure.
Method SetBlobQuantum set the current value of the blob quantum. This is the size in bytes to add to a blob when writing to a blob exceeds its current length.
void SetBlobQuantum (BlobInfo \*blob, const size_t quantum)
A pointer to a BlobInfo structure.
A size_t that reflects the number of bytes to increase a blob.
Method DestroyMagickInfo deallocates memory associated MagickInfo list.
void DestroyMagickInfo (void)
Method GetImageMagick searches for an image format that matches the specified magick string. If one is found the tag is returned otherwise NULL.
char \*GetImageMagick (const unsigned char \*magick, const unsigned int length)
Method GetImageMagick returns a tag that matches the specified magick string.
a character string that represents the image format we are looking for.
The length of the binary string.
Method GetMagickConfigurePath searches a number of pre-defined locations for the specified ImageMagick configuration file and returns the path. The search order follows:
MagickModulesPath HOME/.magick/ MAGICK_HOME/ <program directory>/ MagickLibPath MagickSharePath X11ConfigurePath
char \*GetMagickConfigurePath (const char \*filename)
Method GetMagickConfigurePath returns the path if the configuration file is found, otherwise NULL is returned.
A character string representing the desired configuration file.
Method GetMagickInfo returns a pointer MagickInfo structure that matches the specified tag. If tag is NULL, the head of the image format list is returned.
MagickInfo \*GetMagickInfo (const char \*tag)
Method GetMagickInfo returns a pointer MagickInfo structure that matches the specified tag.
a character string that represents the image format we are looking for.
Method GetMagickVersion returns the ImageMagick API version as a string and as a number.
char \*GetMagickVersion (unsigned int \*version)
Method GetMagickVersion returns the ImageMagick version string.
The ImageMagick version is returned as a number.
Method ListMagickInfo lists the image formats to a file.
void ListMagickInfo (FILE \*file)
A pointer to a FILE structure.
Method MagickIncarnate initializes the ImageMagick environment.
MagickIncarnate (const char \*path)
Specifies a pointer to the execution path of the current ImageMagick client.
Method RegisterMagickInfo adds attributes for a particular image format to the list of supported formats. The attributes include the image format tag, a method to read and/or write the format, whether the format supports the saving of more than one frame to the same file or blob, whether the format supports native in-memory I/O, and a brief description of the format.
MagickInfo \*RegisterMagickInfo (MagickInfo \*entry)
Method RegisterMagickInfo returns a pointer MagickInfo structure that contains the specified tag info.
A pointer to a structure of type MagickInfo.
Method SetMagickInfo allocates a MagickInfo structure and initializes the members to default values.
MagickInfo \*SetMagickInfo (const char \*tag)
Method SetMagickInfo returns the allocated and initialized MagickInfo structure.
a character string that represents the image format associated with the MagickInfo structure.
Method UnregisterMagickInfo removes a tag from the magick info list. It returns False if the tag does not exist in the list otherwise True.
unsigned int UnregisterMagickInfo (const char \*tag)
Method UnregisterMagickInfo returns False if the tag does not exist in the list otherwise True.
a character string that represents the image format we are looking for.
Method CatchImageException returns if no exceptions are found in the image sequence, otherwise it determines the most severe exception and reports it as a warning or error depending on the severity.
CatchImageException (Image \*image)
Specifies a pointer to a list of one or more images.
Method DestroyExceptionInfo deallocates memory associated with an ExceptionInfo structure.
void DestroyExceptionInfo (ExceptionInfo \*exception)
Specifies a pointer to an ExceptionInfo structure.
Method GetExceptionInfo initializes the ExceptionInfo structure.
GetExceptionInfo (ExceptionInfo \*exception)
Specifies a pointer to a ExceptionInfo structure.
Method GetImageException traverses an image sequence and returns any error more severe than noted by the exception parameter.
GetImageException (Image \*image, ExceptionInfo \*exception)
Specifies a pointer to a list of one or more images.
return the highest severity exception.
Method MagickError calls the error handler methods with an error reason.
void MagickError (const ExceptionType error, const char \*reason, const char \*description)
Specifies the numeric error category.
Specifies the reason to display before terminating the program.
Specifies any description to the reason.
Method MagickWarning calls the warning handler methods with a warning reason.
void MagickWarning (const ExceptionType warning, const char \*reason, const char \*description)
Specifies the numeric warning category.
Specifies the reason to display before terminating the program.
Specifies any description to the reason.
Method SetErrorHandler sets the error handler to the specified method and returns the previous error handler.
ErrorHandler SetErrorHandler (ErrorHandler handler)
Specifies a pointer to a method to handle errors.
Method SetWarningHandler sets the warning handler to the specified method and returns the previous warning handler.
ErrorHandler SetWarningHandler (ErrorHandler handler)
Specifies a pointer to a method to handle warnings.
Method ThrowException throws an exception with the specified severity code, reason, and optional description.
void ThrowException (ExceptionInfo \*exception, const ExceptionType severity, const char \*reason, const char \*description)
Specifies a pointer to the ExceptionInfo structure.
This ExceptionType declares the severity of the exception.
Specifies the reason to display before terminating the program.
Specifies any description to the reason.
Method AcquireMemory returns a pointer to a block of at least size bytes suitably aligned for any use.
void \*AcquireMemory (const size_t size)
Method AcquireMemory returns a pointer to a block of at least size bytes suitably aligned for any use.
Specifies the size of the memory to return.
Method LiberateMemory frees memory that has already been allocated.
void LiberateMemory (void \*\*memory)
Specifies the pointer to a block memory to free for reuse.
Method ReacquireMemory changes the size of the memory and returns a pointer to the (possibly moved) block. The contents will be unchanged up to the lesser of the new and old sizes.
void ReacquireMemory (void \*\*memory, const size_t size)
Method ReacquireMemory returns a pointer to a block of at least size bytes suitably aligned for any use.
Specifies the size of the memory to return.
Method MagickMonitor calls the monitor handler methods with a text string that describes the task and a measure of completion.
void MagickMonitor (const char \*text, const off_t quantum, const off_t span)
Specifies the quantum position within the span which represents how much progress has been made in completing a task.
Specifies the span relative to completing a task.
Method SetMonitorHandler sets the monitor handler to the specified method and returns the previous monitor handler.
MonitorHandler SetMonitorHandler (MonitorHandler handler)
Specifies a pointer to a method to handle monitors.
Method XAnimateBackgroundImage animates an image sequence in the background of a window.
void XAnimateBackgroundImage (Display \*display, XResourceInfo \*resource_info, Image \*image)
Specifies a connection to an X server returned from XOpenDisplay.
Specifies a pointer to a X11 XResourceInfo structure.
Specifies a pointer to a Image structure returned from ReadImage.
Method XAnimateImages displays an image via X11.
Image \*XAnimateImages(Display \*display, XResourceInfo \*resource_info, char \*\*argv, const int argc, Image \*image)
Specifies a connection to an X server returned from XOpenDisplay.
Specifies a pointer to a X11 XResourceInfo structure.
Specifies the application's argument list.
Specifies the number of arguments.
Specifies a pointer to a Image structure returned from ReadImage.
Method XDisplayBackgroundImage displays an image in the background of a window.
unsigned int XDisplayBackgroundImage (Display \*display, XResourceInfo \*resource_info, Image \*image)
Method XDisplayBackgroundImage returns True if the designated window is the root window.
Specifies a connection to an X server returned from XOpenDisplay.
Specifies a pointer to a X11 XResourceInfo structure.
Specifies a pointer to a Image structure returned from ReadImage.
Method XDisplayImage displays an image via X11. A new image is created and returned if the user interactively transforms the displayed image.
Image \*XDisplayImage (Display \*display, XResourceInfo \*resource_info, char \*\*argv, int argc, Image \*\*image, unsigned long \*state)
Method XDisplayImage returns an image when the user chooses 'Open Image' from the command menu or picks a tile from the image directory. Otherwise a null image is returned.
Specifies a connection to an X server returned from XOpenDisplay.
Specifies a pointer to a X11 XResourceInfo structure.
Specifies the application's argument list.
Specifies the number of arguments.
Specifies an address to an address of an Image structure returned from ReadImage.
Method CloseCacheView closes the specified view returned by a previous call to OpenCacheView().
void CloseCacheView (ViewInfo \*view)
The address of a structure of type ViewInfo.
Method GetCacheView gets pixels from the in-memory or disk pixel cache as defined by the geometry parameters. A pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.
PixelPacket \*GetCacheView (ViewInfo \*view, const int x, const int y, const unsigned int columns, const unsigned int rows)
Method GetCacheView returns a null pointer if an error occurs, otherwise a pointer to the view pixels.
The address of a structure of type ViewInfo.
These values define the perimeter of a region of pixels.
Method GetCacheViewIndexes returns the colormap indexes associated with the specified view.
IndexPacket \*GetCacheViewIndexes (const ViewInfo \*view)
Method GetCacheViewIndexes returns the colormap indexes associated with the specified view.
The address of a structure of type ViewInfo.
Method GetCacheViewPixels returns the pixels associated with the specified specified view.
PixelPacket \*GetCacheViewPixels (const ViewInfo \*view)
Method GetCacheViewPixels returns the pixels associated with the specified view.
The address of a structure of type ViewInfo.
Method OpenCacheView opens a view into the pixel cache.
ViewInfo \*OpenCacheView (Image \*image)
The address of a structure of type Image.
Method SetCacheView gets pixels from the in-memory or disk pixel cache as defined by the geometry parameters. A pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.
PixelPacket \*SetCacheView (ViewInfo \*view, const int x, const int y, const unsigned int columns, const unsigned int rows)
Method SetCacheView returns a null pointer if an error occurs, otherwise a pointer to the view pixels.
The address of a structure of type ViewInfo.
These values define the perimeter of a region of pixels.
Method SyncCacheView saves the view pixels to the in-memory or disk cache. The method returns True if the pixel region is synced, otherwise False.
unsigned int SyncCacheView (ViewInfo \*view)
Method SyncCacheView returns True if the view pixels are transferred to the in-memory or disk cache otherwise False.
The address of a structure of type ViewInfo.
Matrix Structure | ||
Member | Type | Description |
Matrix Structure (continued) | ||
Member | Type | Description |
sx | x scale. | |
sy | y scale. | |
rx | x rotate. | |
ry | y rotate. | |
tx | x translate. | |
ty | y translate. | |
The members of the ColorPacket structure are shown in the following table:
ColorPacket Structure | ||
Member | Type | Description |
ColorPacket Structure (continued) | ||
Member | Type | Description |
red | red. | |
green | green. | |
blue | blue. | |
index | index. | |
The members of the DrawInfo structure are shown in the following table. The structure is initialized to reasonable defaults by first initializing the equivalent members of ImageInfo, and then initializing the entire structure using GetDrawInfo().
DrawInfo Structure | ||
Member | Type | Description |
DrawInfo Structure (continued) | ||
Member | Type | Description |
affine | Coordinate transformation (rotation, scaling, and translation). | |
border_color | Border color. | |
box | Text solid background color. | |
decorate | Text decoration type. | |
density | Text rendering density in DPI (effects scaling font according to pointsize). E.g. "72x72". | |
fill | Object internal fill (within outline) color. | |
font | Font to use when rendering text. | |
gravity | Text placement preference (e.g. NorthWestGravity). | |
linewidth | Stroke (outline) drawing width in pixels. | |
pointsize | Font size (also see density). | |
primitive | Space or new-line delimited list of text drawing primitives (e.g "text 100, 100 Cockatoo"). See the table Drawing Primitives for the available drawing primitives. | |
stroke | PixelPacket | Object stroke (outline) color. |
stroke_antialias | Set to True (non-zero) to obtain anti-aliased stroke rendering. | |
text_antialias | Set to True (non-zero) to obtain anti-aliased text rendering. | |
tile | Image texture to draw with. Use an image containing a single color (e.g. a 1x1 image) to draw in a solid color. | |
The members of the ExceptionInfo structure are shown in the following table:
ExceptionInfo Structure | ||
Member | Type | Description |
ImageInfo Structure (continued) | ||
Member | Type | Description |
severity | warning or error severity. | |
reason | warning or error message. | |
description | warning or error description. | |
The image pixels are represented by the structure PixelPacket and are cached in-memory, or on disk, depending on the cache threshold setting. This cache is known as the "pixel cache". Pixels in the cache may not be edited directly. They must first be made visible from the cache via a pixel view. A pixel view is a rectangular view of the pixels as defined by a starting coordinate, and a number of rows and columns. When considering the varying abilities of multiple platforms, the most reliably efficient pixel view is comprized of part, or all, of one image row.
There are two means of accessing pixel views. When using the default view, the pixels are made visible and accessable by using the GetImagePixels() method which provides access to a specified region of the image. After the view has been updated, thhe pixels may be saved back to the cache in their original positions via SyncImagePixels(). In order to create an image with new contents, or to blindly overwrite existing contents, the method SetImagePixels() is used to reserve a pixel view corresponding to a region in the pixel cache. Once the pixel view has been updated, it may be written to the cache via SyncImagePixels(). The function GetIndexes() provides access to the image colormap, represented as an array of type IndexPacket.
A more flexible interface to the image pixels is via the CacheView interface. This interface supports multiple pixel cache views (limited by the number of image rows), each of which are identified by a handle (of type ViewInfo*). Use OpenCacheView() to obtain a new cache view, CloseCacheView() to discard a cache view, GetCacheView() to access an existing pixel region, SetCacheView() to define a new pixel region, and SyncCacheView() to save the updated pixel region. The function GetCacheViewIndexes() provides access to the colormap indexes associated with the pixel view.
When writing encoders and decoders for new image formats, it is convenient to have a high-level interface available which supports converting between external pixel representations and ImageMagick's own representation. Pixel components (red, green, blue, opacity, RGB, or RGBA) may be transferred from a user-supplied buffer into the default view by using PushImagePixels(). Pixel components may be transferred from the default view into a user-supplied buffer by using PopImagePixels(). Use of this high-level interface helps protect image coders from changes to ImageMagick's pixel representation and simplifies the implementation.
The members of the Image structure are shown in the following table:
ImageInfo Structure | ||
Member | Type | Description |
ImageInfo Structure (continued) | ||
Member | Type | Description |
attributes | ImageAttribute | Image attribute list. Consists of a doubly-linked-list of ImageAttribute structures, each of which has an associated key and value. Access/update list via SetImageAttribute() and GetImageAttribute(). Key-strings used by ImageMagick include "Comment" (image comment) , "Label" (image label), and "Signature" (image signature). |
background_color | PixelPacket | Image background color |
blur | double | Blur factor to apply to the image when zooming |
border_color | PixelPacket | Image border color |
chromaticity | ChromaticityInfo | Red, green, blue, and white-point chromaticity values. |
color_class | ClassType | Image storage class. If DirectClass then the image packets contain valid RGB or CMYK colors. If PseudoClass then the image has a colormap referenced by pixel's index member. |
color_profile | ProfileInfo | ICC color profile. Specifications are available from the International Color Consortium for the format of ICC color profiles. |
colormap | PixelPacket | PseudoColor palette array. |
colors | unsigned int | The desired number of colors. Used by QuantizeImage(). |
colorspace | ColorspaceType | Image pixel interpretation.If the colorspace is RGB the pixels are red, green, blue. If matte is true, then red, green, blue, and index. If it is CMYK, the pixels are cyan, yellow, magenta, black. Otherwise the colorspace is ignored. |
columns | unsigned int | Image width |
comments | char * Image comments | |
compression | CompressionType | Image compresion type. The default is the compression type of the specified image file. |
delay | unsigned int | Time in 1/100ths of a second (0 to 65535) which must expire before displaying the next image in an animated sequence. This option is useful for regulating the animation of a sequence of GIF images within Netscape. |
depth | unsigned int | Image depth (8 or 16). QuantumLeap must be defined before a depth of 16 is valid. |
directory | char * | Tile names from within an image montage. Only valid after calling MontageImages() or reading a MIFF file which contains a directory. |
dispose | unsigned int | GIF disposal method. This option is used to control how successive frames are rendered (how the preceding frame is disposed of) when creating a GIF animation. |
exception | ExceptionInfo | Record of any error which occurred when updating image. |
file | FILE * | Stdio stream to read image from or write image to. If set, ImageMagick will read from or write to the stream rather than opening a file. Used by ReadImage() and WriteImage(). The stream is closed when the operation completes. |
filename | char[MaxTextExtent] | Image file name to read or write. |
filesize | long int | Number of bytes of the encoded file. |
filter | FilterTypes | Filter to use when resizing image. The reduction filter employed has a significant effect on the time required to resize an image and the resulting quality. The default filter is Lanczos which has been shown to produce high quality results when reducing most images. |
fuzz | int | Colors within this distance are considered equal. A number of algorithms search for a target color. By default the color must be exact. Use this option to match colors that are close to the target color in RGB space. |
gamma | double | Gamma level of the image. The same color image displayed on two different workstations may look different due to differences in the display monitor. Use gamma correction to adjust for this color difference. |
geometry | char * | Preferred size of the image when encoding. |
interlace | InterlaceType | 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, and PlaneInterlace 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 | ProfileInfo | IPTC profile. Specifications are available from the International Press Telecommunications Council for IPTC profiles. |
iterations | unsigned int | Number of iterations to loop an animation (e.g. Netscape loop extension) for. |
list | struct _Image * | Undo image list (used only by 'display') |
magick | char[MaxTextExtent] | Image encoding format (e.g. "GIF"). |
magick_columns | unsigned int | Base image width (before transformations) |
magick_filename | char[MaxTextExtent] | Base image filename (before transformations) |
magick_rows | unsigned int | Base image height (before transformations) |
matte | unsigned int | If non-zero, then the index member of pixels represents the alpha channel. |
matte_color | PixelPacket | Image matte (transparent) color |
mean_error_per_pixel | unsigned int | The mean error per pixel computed when an image is color reduced. This parameter is only valid if verbose is set to true and the image has just been quantized. |
montage | char * | Tile size and offset within an image montage. Only valid for montage images. |
next | struct _Image * | Next image frame in sequence |
normalized_maximum_error | double | The normalized max error per pixel computed when an image is color reduced. This parameter is only valid if <i>verbose</i> is set to true and the image has just been quantized. |
normalized_mean_error | double | The normalized mean error per pixel computed when an image is color reduced. This parameter is only valid if verbose is set to true and the image has just been quantized. |
offset | int | Number of initial bytes to skip over when reading raw image. |
page | RectangleInfo | Equivalent size of Postscript page. |
pipe | int | Set to <i>True</i> if image is read/written from/to a POSIX pipe. To read from (or write to) an open pipe, set this member to True, set the file member to a stdio stream representing the pipe (obtained from popen()), and invoke ReadImage(), WriteImage(). The pipe is automatically closed via pclose() when the operation completes. |
pixels | PixelPacket | Image pixels retrieved via GetPixelCache() or initialized via SetPixelCache(). |
previous | struct _Image * | Previous image frame in sequence. |
rendering_intent | RenderingIntent | The type of rendering intent. |
rows | unsigned int | Image height |
scene | unsigned int | Image frame scene number. |
tainted | int | Set to non-zero (True) if the image pixels have been modified. |
tile_info | RectangleInfo | Describes a tile within an image. For example, if your images is 640x480 you may only want 320x256 with an offset of +128+64. It is used for raw formats such as RGB and CMYK as well as for TIFF. |
timer | TimerInfo | Support for measuring actual (user + system) and elapsed execution time. |
total_colors | unsigned long | The number of colors in the image after QuantizeImage(), or QuantizeImages() if the verbose flag was set before the call. Calculated by GetNumberColors(). |
units | ResolutionType | Units of image resolution |
x_resolution | double | Horizontal resolution of the image. |
y_resolution | double | Vertical resolution of the image |
The members of the ImageAttribute structure are shown in the following table:
ImageAttribute Structure | ||
Member | Type | Description |
ImageAttribute Structure (continued) | ||
Member | Type | Description |
key | key. | |
value | value. | |
compression | compression. | |
The structure is used to supply option information to the methods AllocateImage(), AnimateImages(), BlobToImage(), CloneAnnotateInfo(), DisplayImages(), GetAnnotateInfo(), ImageToBlob(), PingImage(), ReadImage(), ReadImages(), and, WriteImage(). These methods update information in ImageInfo to reflect attributes of the current image.
Use CloneImageInfo() to duplicate an existing ImageInfo structure or allocate a new one. Use DestroyImageInfo() to deallocate memory associated with an ImageInfo structure. Use GetImageInfo() to initialize an existing ImageInfo structure. Use SetImageInfo() to set image type information in the ImageInfo structure based on an existing image.
The members of the ImageInfo structure are shown in the following table:
ImageInfo Structure | ||
Member | Type | Description |
ImageInfo Structure (continued) | ||
Member | Type | Description |
adjoin | unsigned int | Join images into a single multi-image file. |
antialias | unsigned int | Control antialiasing of rendered graphic primitives and text fonts. |
background_color | PixelPacket | Image background color. |
border_color | PixelPacket | Image border color. |
box | char * | Base color that annotation text is rendered on. |
colorspace | ColorspaceType | Image pixel interpretation. If the colorspace is RGB the pixels are red, green, blue. If matte is true, then red, green, blue, and index. If it is CMYK, the pixels are cyan, yellow, magenta, black. Otherwise the colorspace is ignored. |
compression | CompressionType | Image compresion type. The default is the compression type of the specified image file. |
delay | char * | Time in 1/100ths of a second (0 to 65535) which must expire before displaying the next image in an animated sequence. This option is useful for regulating the animation of a sequence of GIF images within Netscape. |
density | char * | Vertical and horizontal resolution in pixels of the image. This option specifies an image density when decoding a Postscript or Portable Document page. Often used with page. |
depth | unsigned int | Image depth (8 or 16). QuantumLeap must be defined before a depth of 16 is valid. |
dispose | char * | GIF disposal method. This option is used to control how successive frames are rendered (how the preceding frame is disposed of) when creating a GIF animation. |
dither | unsigned int | 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 several neighboring pixels. Images which suffer from severe contouring when reducing colors can be improved with this option. The colors or monochrome option must be set for this option to take effect. |
file | FILE * | Stdio stream to read image from or write image to. If set, ImageMagick will read from or write to the stream rather than opening a file. Used by ReadImage() and WriteImage(). The stream is closed when the operation completes. |
filename | char[MaxTextExtent] | Image file name to read or write. |
fill | PixelPacket | Drawing object fill color. |
font | char * | Text rendering font. If the font is a fully qualified X server font name, the font is obtained from an X server. To use a TrueType font, precede the TrueType filename with an @. Otherwise, specify a Postscript font name (e.g. "helvetica"). |
fuzz | int | Colors within this distance are considered equal. A number of algorithms search for a target color. By default the color must be exact. Use this option to match colors that are close to the target color in RGB space. |
interlace | InterlaceType | 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, and PlaneInterlace 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. |
iterations | char * | Number of iterations to loop an animation (e.g. Netscape loop extension) for. |
linewidth | unsigned int | Line width for drawing lines, circles, ellipses, etc. |
magick | char[MaxTextExtent] | Image encoding format (e.g. "GIF"). |
matte_color | PixelPacket | Image matte (transparent) color. |
monochrome | unsigned int | Transform the image to black and white. |
page | char * | Equivalent size of Postscript page. |
ping | unsigned int | Set to True to read enough of the image to determine the image columns, rows, and filesize. The columns, rows, and size attributes are valid after invoking ReadImage() while ping is set. The image data is not valid after calling ReadImage() if ping is set. |
pointsize | double | Text rendering font point size. |
preview_type | PreviewType | Image manipulation preview option. Used by 'display'. |
quality | unsigned int | JPEG/MIFF/PNG compression level (default 75). |
server_name | char * | X11 display to display to obtain fonts from, or to capture image from. |
size | char * | Width and height of a raw image (an image which does not support width and height information). Size may also be used to affect the image size read from a multi-resolution format (e.g. Photo CD, JBIG, or JPEG. |
stroke | PixelPacket | Drawing object outline color. |
subimage | unsigned int | Subimage of an image sequence. |
subrange | unsigned int | Number of images relative to the base image. |
texture | char * | Image filename to use as background texture. |
tile | char * | Tile name. |
units | ResolutionType | Units of image resolution. |
verbose | unsigned int | Print detailed information about the image if True. |
view | char * | FlashPix viewing parameters. |
Support for formats may be provided as a module which is part of the ImageMagick library, provided by a module which is loaded dynamically at run-time, or directly by the linked program. Users of ImageMagick will normally want to create a loadable-module, or support encode/decode of an image format directly from within their program.
MagickInfo Structure | ||
Member | Type | Description |
MagickInfo Structure (continued) | ||
Member | Type | Description |
tag | Magick string (e.g. "GIF") to call this format. | |
decoder | Function to decode image data and return ImageMagick Image. | |
encoder | Function to encode image data with options passed via ImageInfo and image represented by Image. | |
adjoin | Set to non-zero (True) if this file format supports multi-frame images. | |
blob_support | Set to non-zero (True) if the encoder and decoder for this format supports operating arbitrary BLOBs (rather than only disk files). | |
raw | Image format does not contain size (must be specified in ImageInfo). | |
description | Long form image format description (e.g. "CompuServe graphics interchange format"). | |
module | Name of module (e.g. "GIF") which registered this format. Set to NULL if format is not registered by a module. | |
data | User specified data. A way to pass any sort of data structure to the endoder/decoder. To set this, GetMagickInfo() must be called to first obtain a pointer to the registered structure since it can not be set via a RegisterMagickInfo() parameter. | |
previous | Previous MagickInfo struct in linked-list. NULL if none. | |
next | Next MagickInfo struct in linked-list. NULL if none. | |
The members of the PixelPacket structure are shown in the following table:
PixelPacket Structure | ||
Member | Type | Description |
PixelPacket Structure (continued) | ||
Member | Type | Description |
red | red. | |
green | green. | |
blue | blue. | |
opacity | opacity. | |
The members of the ProfileInfo structure are shown in the following table:
ProfileInfo Structure | ||
Member | Type | Description |
ProfileInfo Structure (continued) | ||
Member | Type | Description |
length | length. | |
info | data. | |
The members of the RectangleInfo structure are shown in the following table:
RectangleInfo Structure | ||
Member | Type | Description |
RectangleInfo Structure (continued) | ||
Member | Type | Description |
width | width. | |
height | height. | |
x | x. | |
y | y. | |
ChannelType Enumeration | |
Enumeration | Description |
ChannelType Enumeration (continued) | |
Enumeration | Description |
UndefinedChannel | Unset value. |
RedChannel | Select red channel. |
GreenChannel | Select green channel. |
BlueChannel | Select blue channel. |
MatteChannel | Select matte (opacity values) channel. |
ClassType specifies the image storage class.
ClassType Enumeration | |
Enumeration | Description |
ClassType Enumeration (continued) | |
Enumeration | Description |
UndefinedClass | Unset value. |
DirectClass | Image is composed of pixels which represent literal color values. |
PseudoClass | Image is composed of pixels which specify an index in a color palette. |
When encoding an output image, the colorspaces RGBColorspace, CMYKColorspace, and GRAYColorspace may be specified. The CMYKColorspace option is only applicable when writing TIFF, JPEG, and Adobe Photoshop bitmap (PSD) files.
ColorspaceType Enumeration | |
Enumeration | Description |
ColorspaceType Enumeration (continued) | |
Enumeration | Description |
UndefinedColorspace | Unset value. |
RGBColorspace | Red-Green-Blue colorspace. |
GRAYColorspace | |
TransparentColorspace | The Transparent color space behaves uniquely in that it preserves the matte channel of the image if it exists. |
OHTAColorspace | |
XYZColorspace | |
YCbCrColorspace | |
YCCColorspace | |
YIQColorspace | |
YPbPrColorspace | |
YUVColorspace | Y-signal, U-signal, and V-signal colorspace. YUV is most widely used to encode color for use in television transmission. |
CMYKColorspace | Cyan-Magenta-Yellow-Black colorspace. CYMK is a subtractive color system used by printers and photographers for the rendering of colors with ink or emulsion, normally on a white surface. |
sRGBColorspace | |
CompositeOperator Enumeration | |
Enumeration | Description |
CompositeOperator Enumeration (continued) | |
Enumeration | Description |
UndefinedCompositeOp | Unset value. |
OverCompositeOp | The result is the union of the the two image shapes with the composite image obscuring image in the region of overlap. |
InCompositeOp | The result is a simply composite image cut by the shape of image. None of the image data of image is included in the result. |
OutCompositeOp | The resulting image is composite image with the shape of image cut out. |
AtopCompositeOp | The result is the same shape as image image, with composite image obscuring image there the image shapes overlap. Note that this differs from OverCompositeOp because the portion of composite image outside of image's shape does not appear in the result. |
XorCompositeOp | The result is the image data from both composite image and image that is outside the overlap region. The overlap region will be blank. |
PlusCompositeOp | The result is just the sum of the image data. Output values are cropped to 255 (no overflow). This operation is independent of the matte channels. |
MinusCompositeOp | The result of composite image - image, with overflow cropped to zero. The matte chanel is ignored (set to 255, full coverage). |
AddCompositeOp | The result of composite image + image, with overflow wrapping around (mod 256). |
SubtractCompositeOp | The result of composite image - image, with underflow wrapping around (mod 256). The add and subtract operators can be used to perform reverible transformations. |
DifferenceCompositeOp | The result of abs(composite image - image). This is useful for comparing two very similar images. |
BumpmapCompositeOp | The result image shaded by composite image. |
ReplaceCompositeOp | The resulting image is image replaced with composite image. Here the matte information is ignored. |
ReplaceRedCompositeOp | The resulting image is the red channel in image replaced with the red channel in composite image. The other channels are copied untouched. |
ReplaceGreenCompositeOp | The resulting image is the green channel in image replaced with the green channel in composite image. The other channels are copied untouched. |
ReplaceBlueCompositeOp | The resulting image is the blue channel in image replaced with the blue channel in composite image. The other channels are copied untouched. |
ReplaceMatteCompositeOp | The resulting image is the matte channel in image replaced with the matte channel in composite image. The other channels are copied untouched. The image compositor requires a matte, or alpha channel in the image for some operations. This extra channel usually defines a mask which represents a sort of a cookie-cutter for the image. This is the case when matte is 255 (full coverage) for pixels inside the shape, zero outside, and between zero and 255 on the boundary. For certain operations, if image does not have a matte channel, it is initialized with 0 for any pixel matching in color to pixel location (0, 0), otherwise 255 (to work properly borderWidth must be 0). |
CompressionType Enumeration | |
Enumeration | Description |
CompressionType Enumeration (continued) | |
Enumeration | Description |
UndefinedCompression | Unset value. |
NoCompression | No compression. |
BZipCompression | BZip (Burrows-Wheeler block-sorting text compression algorithm and Huffman coding) as used by bzip2 utilities. |
FaxCompression | CCITT Group 3 FAX compression. |
Group4Compression | CCITT Group 4 FAX compression (used only for TIFF). |
JPEGCompression | JPEG compression. |
LZWCompression | Lempel-Ziv-Welch (LZW) compression. |
RunlengthEncodedCompression | Run-Length encoded (RLE) compression. |
ZipCompression | Lempel-Ziv compression (LZ77) as used in PKZIP and GNU gzip. |
FilterTypes Enumeration | |
Enumeration | Description |
FilterTypes Enumeration (continued) | |
Enumeration | Description |
UndefinedFilter | Unset value. |
PointFilter | Point Filter |
BoxFilter | Box Filter |
TriangleFilter | Triangle Filter |
HermiteFilter | Hermite Filter |
HanningFilter | Hanning Filter |
HammingFilter | Hamming Filter |
BlackmanFilter | Blackman Filter |
GaussianFilter | Gaussian Filter |
QuadraticFilter | Quadratic Filter |
CubicFilter | Cubic Filter |
CatromFilter | Catrom Filter |
MitchellFilter | Mitchell Filter |
LanczosFilter | Lanczos Filter |
BesselFilter | Bessel Filter |
SincFilter | Sinc Filter |
GravityType Enumeration | |
Enumeration | Description |
GravityType Enumeration (continued) | |
Enumeration | Description |
ForgetGravity | Don't use gravity. |
NorthWestGravity | Position object at top-left of region. |
NorthGravity | Postiion object at top-center of region. |
NorthEastGravity | Position object at top-right of region. |
WestGravity | Position object at left-center of region. |
CenterGravity | Position object at center of region. |
EastGravity | Position object at right-center of region. |
SouthWestGravity | Position object at left-bottom of region. |
SouthGravity | Position object at bottom-center of region. |
SouthEastGravity | Position object at bottom-right of region. |
ImageType Enumeration | |
Enumeration | Description |
ImageType Enumeration (continued) | |
Enumeration | Description |
UndefinedType | Unset value. |
BilevelType | Monochrome image. |
GrayscaleType | Grayscale image. |
PaletteType | Indexed color (palette) image. |
PaletteMatteType | Indexed color (palette) image with opacity. |
TrueColorType | Truecolor image. |
TrueColorMatteType | Truecolor image with opacity. |
ColorSeparationType | Cyan/Yellow/Magenta/Black (CYMK) image. |
Use LineInterlace or PlaneInterlace to create an interlaced GIF or progressive JPEG image.
InterlaceType Enumeration | |
Enumeration | Description |
InterlaceType Enumeration (continued) | |
Enumeration | Description |
UndefinedInterlace | Unset value. |
NoInterlace | Don't interlace image (RGBRGBRGBRGBRGBRGB...). |
LineInterlace | Use scanline interlacing (RRR...GGG...BBB...RRR...GGG...BBB...). |
PlaneInterlace | Use plane interlacing (RRRRRR...GGGGGG...BBBBBB...). |
PartitionInterlace | Similar to plane interlaing except that the different planes are saved to individual files (e.g. image.R, image.G, and image.B). |
NoiseType Enumeration | |
Enumeration | Description |
NoiseType Enumeration (continued) | |
Enumeration | Description |
UniformNoise | Uniform noise. |
GaussianNoise | Gaussian noise. |
MultiplicativeGaussianNoise | Multiplicative Gaussian noise. |
ImpulseNoise | Impulse noise. |
LaplacianNoise | Laplacian noise. |
PoissonNoise | Poisson noise. |
PaintMethod Enumeration | |
Enumeration | Description |
PaintMethod Enumeration (continued) | |
Enumeration | Description |
PointMethod | Replace pixel color at point. |
ReplaceMethod | Replace color for all image pixels matching color at point. |
FloodfillMethod | Replace color for pixels surrounding point until encountering pixel that fails to match color at point. |
FillToBorderMethod | Replace color for pixels surrounding point until encountering pixels matching border color. |
ResetMethod | Replace colors for all pixels in image with pen color. |
From the specification: "Rendering intent specifies the style of reproduction to be used during the evaluation of this profile in a sequence of profiles. It applies specifically to that profile in the sequence and not to the entire sequence. Typically, the user or application will set the rendering intent dynamically at runtime or embedding time."
RenderingIntent Enumeration | |
Enumeration | Description |
RenderingIntent Enumeration (continued) | |
Enumeration | Description |
UndefinedIntent | Unset value. |
SaturationIntent | A rendering intent that specifies the saturation of the pixels in the image is preserved perhaps at the expense of accuracy in hue and lightness. |
PerceptualIntent | A rendering intent that specifies the full gamut of the image is compressed or expanded to fill the gamut of the destination device. Gray balance is preserved but colorimetric accuracy might not be preserved. |
AbsoluteIntent | Absolute colorimetric. |
RelativeIntent | Relative colorimetric. |
By default, ImageMagick defines resolutions in pixels per inch. ResolutionType provides a means to adjust this.
ResolutionType Enumeration | |
Enumeration | Description |
ResolutionType Enumeration (continued) | |
Enumeration | Description |
UndefinedResolution | Unset value. |
PixelsPerInchResolution | Density specifications are specified in units of pixels per inch (english units). |
PixelsPerCentimeterResolution | Density specifications are specified in units of pixels per centimeter (metric units). |
An image has certain attributes associated with it such as width, height, number of colors in the colormap, page geometry, and others. Many of the image methods allow you to set relevant attributes directly in the method call, or you can use Set(), as in:
$image->Set(loop=>100);
$image->[$x]->Set(dither=>1);
To get an imageattribute, use Get():
($width, $height, $depth) = $image->Get('width', 'height', 'depth');
$colors = $image->[2]->Get('colors');
The methods GetAttribute() and SetAttribute() are aliases for Get() and Set() and may be used interchangeably.
Following is a list of image attributes acceptable to either Set() or Get() as noted.
$image- > Set(adjoin= > )
$image- > Get('adjoin')
Certain file formats accept multiple images within a single file (e.g. a GIF animation). If adjoin is value other than 0 and the image is a multi-image format, multiple reads to the same image object will join the images into a single file when you call the Write() method. Set adjoin to 0 if you do not want the images output to a single file.
$image- > Set(antialias= > )
$image- > Get('antialias')
The visible effect of antialias is to blend the edges of any text or graphics with the image background. This attribute affects how text and graphics are rendered when certain image formats are read (e.g. Postscript or SVG) or when certain Image::Magick methods are called (e.g. Annotate() or Draw()).
$image- > Set(background= > )
$image- > Get('background')
This attribute sets (or gets) the background color of an image. Image formats such as GIF, PICT, PNG, and WMF retain the background color information.
$image- > Get('base-filename'')
The original filename is returned as a string.
$image- > Get('base-height'')
This attribute returns the original height of image before any resizing operation.
$image- > Get('base-width'')
This attribute returns the original width of image before any resizing operation.
$image- > Set(blue-primary= > ,)
$image- > Get('blue-primary')
This attribute sets or returns the chromaticity blue primary point. This is a color management option.
$image- > Set(cache-threshold= > )
$image- > Get('cache-threshold')
Image pixels are stored in your computer's memory until it has been consumed or the cache threshold is exceeded. Subsequent pixel operations are cached to disk. Operations to memory are significantly faster, but if your computer does not have a sufficient amount of free memory to read or transform an image, you may need to set this threshold to a small megabyte value (e.g. 32). Use 0 to cache all images to disk.
$image- > Get('class')
A Direct class image is a continuous tone image and is stored as a sequence of red-green-blue and optional opacity intensity values. A Pseudo class image is an image with a colormap, where the image is stored as a map of colors and a sequence of indexes into the map.
$image- > Set('colormap[]'= > )
$image- > Get('colormap[]')
This attribute returns the red, green, blue, and opacity values at colormap position . You can set the color with a colorname (e.g. red) or color hex value (e.g. #ccbdbd).
$image- > Get('colors')
This attribute returns the number of distinct colors in the image.
$image- > Get('comment')
Set or return the image comment.
$image- > Set(compress= > )
$image- > Get('compress')
Compress defaults to the compression type of the image when it was first read. The value of compress can be one of the following:
0000¯1111111111111111¯2222222222222222¯3333333333333333
None BZip Fax
Group4 JPEG LosslessJPEG
LZW RLE Zip
If you set a compression type that is incompatible with the output file type, a compatible compression value is used instead (e.g. a PNG image ignores a compress value of JPEG and saves with Zip compression).
$image- > Set(delay= > )
$image- > Get('delay')
Delay regulates the playback speed of a sequence of images. The value is the number of hundredths of a second that must pass before displaying the next image. The default is 0 which means there is no delay and the animation will play as fast as possible.
$image- > Set(density= > )
$image- > Get('density')
This attribute to set the vertical and horizontal resolution of an image. Use attribute units to define the units of resolution. The default is 72 dots-per-inch.
$image- > Get('depth')
Return the color component depth of the image, either 8 or 16. A depth of 8 represents color component values from 0 to 255 while a depth of 16 represents values from 0 to 65535.
$image- > Get('directory')
A montage is one or more image thumbnails regularly spaced across a color or textured background created by the Montage() method or montage program. Directory returns the filenames associated with each thumbnail.
$image- > Set(dispose= > )
$image- > Get('dispose')
The dispose attribute sets the GIF disposal method that defines how an image is refreshed when flipping between scenes in a sequence. The disposal methods are defined as:
0000¯1111111111¯222222222222222
0 replace one full-size, non-transparent frame with another
1 any pixels not covered up by the next frame continue to display
2 background color or background tile shows through transparent pixels
3 restore to the state of a previous, undisposed frame
$image- > Set(dither= > )
$image- > Get('dither')
Color reduction is performed implicitly when an image is converted from a file format that allows many colors to one that allows fewer (e.g. JPEG to GIF). Dithering helps smooth out the apparent contours produced when sharply reducing colors. The default is to dither an image during color reduction.
$image- > Get('error')
This value reflects the mean error per pixel introduced when reducing the number of colors in an image either implicitedly or explicitly:
The mean error gives one measure of how well the color reduction algorithm performed and how similiar the color reduced image is to the original.
$image- > Set(file= > )
$image- > Get('file')
The Read() and Write() methods accept an already opened Perl filehandle and the image is read or written directly from or to the specified filehandle.
$image- > Set(filename= > )
$image- > Get('filename')
The default filename is the name of the file from which the image was read. Write() accepts a filename as a parameter, however, if you do not specify one, it uses the name defined by the filename attribute. For example:
$image->Read('logo.gif');
$image->Write(); # write image as logo.gif
$image->Set(filename=>'logo.png');
$image->Write(); # write image as logo.png
$image- > Get('filesize')
Returns the number of bytes the image consumes in memory or on disk.
$image- > Set(font= > )
$image- > Get('filesize')
Both Annotate() and Draw() require a font to render text to an image. A font can be Truetype (Arial.ttf), Postscript (Helvetica), or a fully-qualified X11 font (-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-*) name.
$image- > Get('format')
Attribute magick returns the abbreviated image format (e.g. JPEG) while format returns more descriptive text about the format (e.g. Joint Photographic Experts Group JFIF format).
$image- > Set(fuzz= > )
$image- > Get('fuzz')
A number of image methods (e.g. ColorFloodfill()) compare a target color to a color within the image. By default these colors must match exactly. However, in many cases two colors may differ by a small amount. Fuzz defines how much tolerance is acceptable to consider two different colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color.
$image- > Set(gamma= > )
$image- > Get('gamma')
Set or return the image gamma value. Unlike Gamma() that actually applies the gamma value to the image pixels, here we just set the value. This is useful if the correct gamma is already known about a particular image.
$image- > Set(geometry= > )
$image- > Get('geometry')
The geometry attribute is a convenient way to specify the width, height, and any offset of an image region as a single string. For example,
geometry=>'640x80'
is equivalent to:
width=>640, height=>480
To refer to a 20 x 20 region of pixels starting at coordinate (100, 150), use:
geometry=>'20x20+100+150'
$image- > Set(green-primary= > ,)
$image- > Get('green-primary')
This attribute sets or returns the chromaticity green primary point. This is a color management option.
$image- > Get('height'')
This attribute returns the height (in pixel rows) of the image.
$image- > Set('index[]'= > )
$image- > Get('index[]')
This attribute sets or returns the colormap index at position (). The result is undefined if the image does not have a colormap or the specified location lies outside the the image area.
$image- > Set(interlace= > )
$image- > Get('interlace')
The interlace attribute allows you to specify the interlacing scheme used by certain image formats such as GIF, JPEG, RGB, and CMYK. The default is None but can be any of the following:
0000¯1111111111¯222222222222222
None no interlacing
Line scanline interlacing
Plane plane interlacing
Partition partition interlacing
$image- > Set(label= > )
$image- > Get('label')
Use labels to optionally annotate a Postscript or PDF image or the thumbnail images of a montage created by the Montage() method or montage program. A label can include any of the special formatting characters described in the Comment() method description.
$image- > Set(label= > )
$image- > Get('loop')
The loop attribute adds the Netscape looping extension to an image sequence. A value of 0 causes the animation sequence to loop continuously. Any other value results in the animation being repeated for the specified number of times. The default value is 1.
$image- > Set(magick= > )
$image- > Get('magick')
The default image format is whatever format the image was in when it was read. Write() accepts an image format as a parameter, however, if you do not specify one, it uses the format defined by the magick attribute. For example:
$image->Read('logo.gif');
$image->Write(); # write image as GIF
$image->Set(magick=>'PNG');
$image->Write(); # write image as PNG
$image- > Set(matte= > )
$image- > Get('magick')
Some images have a transparency mask associated with each pixel ranging from opaque (pixel obscures background) to fully transparent (background shows thru). The transparency mask, if it exists, is ignored if the matte attribute is 0 and all pixels are treated as opaque.
$image- > Get('maximum-error')
This value reflects the normalized maximum per pixel introduced when reducing the number of colors in an image either implicitedly or explicitly:
The normalized maximum error gives one measure of how well the color reduction algorithm performed and how similiar the color reduced image is to the original.
$image- > Get('mean-error')
This value reflects the normalized mean per pixel introduced when reducing the number of colors in an image either implicitedly or explicitly:
The normalized mean error gives one measure of how well the color reduction algorithm performed and how similiar the color reduced image is to the original.
$image- > Get('montage')
A montage is one or more image thumbnails regularly spaced across a color or textured background returned by the Montage() method or montage program. The montage attribute returns the geometry of the region associated with each image thumbnail (e.g. 160x120+10+10). This information is useful for creating image maps for dynamic web pages.
$image- > Set(page= > )
$image- > Get('page')
Page declares the image canvas size and location. Typically this is only useful for the Postscript, text, and GIF formats. The value of string can be:
0000¯1111111111111111¯2222222222222222¯3333333333333333
Letter Tabloid Ledger
Legal Statement Executive
A3 A4 A5
B4 B5 Folio
Quarto 10x14
or a geometry (612x792). The default value is Letter.
$image- > Set(pointsize= > )
$image- > Get('pointsize')
The pointsize attribute determines how large to draw a Postscript or TrueType font with the Annotate() or Draw() methods. The default is 12.
$image- > Set(preview= > )
$image- > Get('preview')
Set or get the type of preview for the Preview image format.
0000¯1111111111111111¯2222222222222222¯3333333333333333
Rotate Shear Roll
Hue Saturation Brightness
Gamma Spiff Dull
Grayscale Quantize
Despeckle ReduceNoise
AddNoise Sharpen Blur
Threshold EdgeDetect
Spread Solarize Shade
Raise Segment Swirl
Implode Wave OilPaint
CharcoalDrawing JPEG
Suppose we want to determine an ideal gamma setting for our image:
$image->Write(filename=>'model.png',preview=>'Gamma');
$image->Display();
$image- > Set(quality= > )
$image- > Get('quality')
The quality attribute sets the JPEG, MIFF, or PNG compression level. The range is 0 (worst) to 100 (best). The default is 75.
Quality is a trade-off between image size and compression speed for the MIFF and PNG formats. The higher the quality, the smaller the resulting image size but with a requisite increase in compute time. The JPEG trade-off is between image size and image appearance. A high quality returns an image nearly free of compression artifacts but with a larger image size. If you can accept a lower quality image appearance, the resulting image size would be considerably less.
$image- > Set(red-primary= > ,)
$image- > Get('red-primary')
This attribute sets or returns the chomaticity red primary point. This is a color management option.
$image- > Set(rendering-intent= > )
$image- > Get('rendering-intent')
This is a color management option. Choose from these models:
0000¯1111111111111111¯2222222222222222¯3333333333333333
Undefined Saturation Perceptual
Absolute Relative
$image- > Set(scene= > )
$image- > Get('scene')
By default each image in a sequence has a scene number that starts at 0 and each subsequent image in the sequence increments by 1. Use scene to reset this value to whatever is appropriate for your needs.
$image- > Get('signature')
Retrieves the MD5 public key signature associated with the image. A signature is generated across all the image pixels. If a single pixel changes, the signature will change as well. The signature is mostly useful for quickly determining if two images are identical or if an image has been modified.
$image- > Set(size= > )
$image- > Get('size')
Set the size attribute before reading an image from a raw data file format such as RGB, GRAY, TEXT, or CMYK (e.g. 640x480) or identify a desired resolution for Photo CD images (e.g. 768x512).
$image->Set(size=>'640x480');
$image->Read('gray:protein');
$image- > Set(server= > )
$image- > Get('server')
Display(), Animate(), or any X11 font use with Annotate() require contact with an X server. Use server to specify which X server to contact (e.g. mysever:0).
$image- > Get('taint')
Taint returns a value other than 0 if any image pixel has modified since it was first read.
$image- > Set(texture= > )
$image- > Get('texture')
The texture attribute assigns a filename of a texture to be tiled onto the image background when any TXT or WMF image formats are read.
$image- > Set(type= > )
$image- > Get('type')
The image type can be any of the following
0000¯1111111111111111¯2222222222222222¯3333333333333333
Bilevel Grayscale GrayscaleMatte
Palette PaletteMatte TrueColor
TrueColorMatte ColorSeparation ColorSeparationMatte
When getting this attribute, the value reflects the type of image pixels. For example a colormapped GIF image would most likely return Palette as the image type. You can also force a particular type with Set(). For example if you want to force your color image to black and white, use:
$image->Set(type=>'Bilevel');
$image- > Set(units= > )
$image- > Get('units')
Return or set the units in which the image's resolution are defined. Values may be:
0000¯111111111111111
Undefined
pixels/inch
pixels/centimeter
$image- > Set(units= > )
$image- > Get('units')
When set, verbose causes some image operations to print details about the operation as it progresses.
$image- > Set(white-point= > ,)
$image- > Get('white-point')
This attribute sets or returns the chomaticity white point. This is a color management option.
$image- > Get('width')
Returns the width (integer number of pixel columns) of the image.
$image- > Get('x-resolution')
Returns the x resolution of the image in the units defined by the units attribute (e.g. 72 pixels/inch). Use the density attribute to change this value.
$image- > Get('y-resolution')
Returns the y resolution of the image in the units defined by the units attribute (e.g. 72 pixels/inch). Use the density attribute to change this value.
$image- > AddNoise(noise= > )
This method adds random noise to the image, where specifies one of the following types:
0000¯1111111111111111¯2222222222222222¯3333333333333333
Uniform Gaussian Multiplicative
Impulse Laplacian Poisson
$image- > Animate()
Animate() repeatedly displays an image sequence to any X window screen. This method accepts the same parameters as Set() as described in section 22.1.
$image- > Annotate(text= > , antialias= > , box= > , density= > , fill= > , font= > , geometry= > , gravity= > , pointsize= > , rotate= > , scale= > , skewX= > , skewY= > stroke= > , stroke_width= > , translate= > , x= > , y= > )
Annotate() allows you to scribble text across an image. The text may be represented as a string or filename. Precede the filename with an ampersand (@) and the contents of the file are drawn on the image. You can affect how text is drawn by specifying one or more of the following parameters:
0000¯1111111111111111¯2222222222222222¯3333333333333333
NorthWest, North NorthEast
West Center East
SouthWest South SouthEast
$image- > Append()
The Append() method takes a set of images and appends them to each other. Each image in the set must have the equal width or equal height (or both). Append() returns a single image where each image in the original set is side-by-side if all the heights are equal or stacked on top of each other if all widths are equal.
$append = $image->Append();
$image- > Average()
The Average() method takes a set of images and averages them together. Each image in the set must have the same width and the same height. Average() returns a single image with each corresponding pixel component of each image averaged.
$image- > BlobToImage()
Read() returns an image from a file on disk, whereas, BlobToImage() performs the same function if the image format is stored in memory:
$blob = $db->GetImage(); # get blob from database
$image = Image::Magick->New(magick=>'jpg');
# the blob is a JPEG image
$image->BlobToImage($blob); # convert blob to Image::Magick object
$image- > Blur(geometry= > , radius= > , sigma= > )
Blur() blurs an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, the radius should be larger than sigma. Use a radius of 0 and Blur() selects a suitable radius for you. Geometry represents radius x sigma as one parameter (e.g. 0x1).
$image- > Border(geometry= > , width= > , height= > , fill= > )
This method surrounds the image with a border of the specified color. Geometry represents width x height as one parameter (e.g. 10x5).
$image- > Channel(channel= > );
Extract a channel from the image. A channel is a particular color component of each pixel in the image. Choose from these components:
0000¯111111
Red
Green
Blue
Matte
$image- > Charcoal(geometry= > , radius= > , sigma= > )
Charcoal() is a special effect filter that simulates a charcoal drawing. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and Charcoal() selects a suitable radius for you. Geometry represents radius x sigma as one parameter (e.g. 0x1).
$image- > Chop(geometry= > geometry, width= > integer, height= > integer, x= > integer, y= > integer)
Chop() removes a region of an image and collapses the image to occupy the removed portion. Columns x through x+width and the rows y through y+height are chopped. Use Geometry as a shortcut for width x height + x + y (e.g. 100x50+10+20).
$image- > Clone()
The Clone() method copies a set of images and returns the copy as a new image object. For example
$clone = $image=>Clone();
copies all of the images from $image to $clone.
$image- > Coalesce()
This method composites a set of images while respecting any page offsets and disposal methods. GIF, MIFF, and MNG animation sequences typically start with an image background and each subsequent image varies in size and offset. Coalesce() returns a new sequence where each image in the sequence is the same size as the first and composited with the next image in the sequence.
$image- > ColorFloodfill(geometry= > , x= > , y= > , fill= > , bordercolor= > , fuzz= > )
ColorFloodfill() changes the color value of any pixel that matches fill and is an immediate neighbor. If bordercolor is specified, the color value is changed for any neighbor pixel that is not bordercolor. Use Geometry as a shortcut for x + y (e.g. +10+20).
By default fill must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. Fuzz defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color for the purposes of the floodfill.
$image- > Colorize(fill= > , opacity= > )
Colorize() blends the fill color with each pixel in the image. A percentage blend is specified with opacity. Control the application of different color components by specifying a different percentage for each component (e.g. 90/100/10 is 90% red, 100% green, and 10% blue).
$image- > Comment(comment= > )
Add a comment to an image. Optionally you can include any of the following bits of information about the image by embedding the appropriate special characters:
0000¯1111¯222222222222222
%b file size in bytes.
%c comment.
%d directory in which the image resides.
%e extension of the image file.
%f original filename of the image.
%h height of image.
%i filename of the image.
%l image label.
%m image file format.
%n number of images in a image sequence.
%o output image filename.
%p page number of the image.
%q image depth (8 or 16).
%s image scene number.
%t image filename without any extension.
%u a unique temporary filename.
%w image width.
%x x resolution of the image.
%y y resolution of the image.
Given an image whose filename is logo.gif and dimensions of 640 pixels in width and 480 pixels in height, this statement:
$image->Comment('%f %m %wx%h')
generates a comment that reads: logo.gif GIF 640x480.
$image- > Composite(image= > , compose= > , geometry= > , x= > , y= > , gravity= > , opacity= > =, rotate= > , tile= > )
Composite() allows you to overlay one image to another. You can affect how and where the composite is overlaid by specifying one or more of the following options:
0000¯1111111111111111¯2222222222222222¯3333333333333333
Over, In Out
Atop Xor Plus
Minus Add Subtract
Difference Bumpmap Copy
Displace
0000¯1111111111111111¯2222222222222222¯3333333333333333
NorthWest, North NorthEast
West Center East
SouthWest South SouthEast
$image- > Contrast(sharpen= > )
Contrast() enhances the intensity differences between the lighter and darker elements of the image. Set sharpen to a value other than 0 to increase the image contrast otherwise the contrast is reduced.
$image- > Convolve(coefficients= > )
Apply a custom convolution kernel to the image. Given a particular kernel , you must supply float values. For example, a kernel of order 3 implies 9 values (3x3):
$image->Convolve([1, 2, 1, 2, 4, 2, 1, 2, 1]);
$image- > Crop(geometry= > , width= > , height= > , x= > , y= > )
Crop() extracts a region of the image starting at the offset defined by x and y and extending for width and height. Geometry is a shorthard method to define a region. To crop 100 x 50 region that begins at position (10, 20), use
$image->Crop('100x50+10+20');
$image- > CycleColormap(display= > )
CycleColormap() displaces an image's colormap by a given number of positions. If you cycle the colormap a number of times you can produce a psychodelic effect.
$image- > Deconstruct()
Deconstruct() returns a new sequence that consists of the first image in the sequence followed by the maximum bounding region of any differences in subsequent images. This method can undo a coalesced sequence returned by Coalesce().
$image- > Despeckle()
Despeckle() reduces the speckle noise in an image while perserving the edges of the original image.
$image- > Display(server= > )
Display() displays the image to any X window screen.
$image- > Draw(primitive= > , antialias= > , bordercolor= > , density= > , fill= > , font= > , geometry= > , method= > , points= > , pointsize= > , rotate= > , scale= > , skewX= > , skewY= > stroke= > , stroke_width= > , translate= >
Draw() allows you to draw a graphic primitive on your image. The primitive may be represented as a string or filename. Precede the filename with an ampersand (@) and the contents of the file are drawn on the image. You can affect how text is drawn by specifying one or more of the following parameters:
0000¯1111111111111111¯2222222222222222¯3333333333333333
Point Line Rectangle
roundRectangle Arc Ellipse
Circle Polyline Polygon
Bezier Path Color
Matte Text Image
0000¯1111111111111111¯2222222222222222¯3333333333333333
Point Replace Floodfull
FillToBorder Reset
$image- > Edge(radius= > )
Edge() finds edges in an image. Radius defines the radius of the convolution filter. Use a radius of 0 and Edge() selects a suitable radius for you.
Emboss() returns a grayscale image with a three-dimensional effect. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and Emboss() selects a suitable radius for you. Geometry represents radius x sigma as one parameter (e.g. 0x1).
$image- > Enhance()
Enhance() applies a digital filter that improves the quality of a noisy image.
$image- > Equalize()
Perform a histogram equalization on the image.
$image- > Coalesce()
This method composites a sequence of images while respecting any page offsets. A Photoshop image typically starts with an image background and each subsequent layer varies in size and offset. Flatten() returns a single image with all the layers composited onto the first image in the sequence.
$image- > Flip()
Flip() creates a vertical mirror image by reflecting the pixels around the central x-axis.
$image- > Flop()
Flop() creates a horizontal mirror image by reflecting the pixels around the central y-axis.
$image- > Frame(geometry= > , width= > , height= > , inner= > =, outer= > , fill= > )
Frame() adds a simulated three-dimensional border around the image. The color of the border is defined by fill. Width and height specify the border width of the vertical and horizontal sides of the frame. The inner and outer parameters indicate the width of the inner and outer shadows of the frame. Use Geometry as a shortcut for width, height, inner, and outer (e.g. 10x10+3+3).
$image- > Gamma(gamma= > , red= > , green= > , blue= > )
Use Gamma() to gamma-correct an image. The same image viewed on different devices will have perceptual differences in the way the image's intensities are represented on the screen. Specify individual gamma levels for the red, green, and blue channels, or adjust all three with the gamma parameter. Values typically range from 0.8 to 2.3.
You can also reduce the influence of a particular channel with a gamma value of 0.
$image- > Get(, ...)
Get() accepts one or more image attributes listed in section 22.1 and return their value.
$image- > ImageToBlob()
ImageToBlob() behaves just like Write() except the image is returned as a Perl variable rather than written to disk. This method accepts the same parameters as Set() as described in section .
$image- > Implode(amount= > )
Implode() applies a special effects filter to the image where amount determines the amount of implosion. Use a negative amount for an explosive effect.
$image- > Label(label= > )
Use labels to optionally annotate a Postscript or PDF image or the thumbnail images of a montage created by the Montage() method or montage program. A label can include any of the special formatting characters described in the Comment() method description.
$image- > Magnify()
Magnify() is a convenience method that scales an image proportionally to twice its size.
$image- > Map(image= > , dither= > )
Map() changes the colormap of the image to that of the image given by image. Use this method to change the colormap in an image or image sequence to a set of predetermined colors. Set dither to a value other than zero to helps smooth out the apparent contours produced when sharply reducing colors.
One useful example of mapping is to convert an image to the Netscape 216-color web safe palette:
$safe = new Image::Magick;
$safe->Read('Netscape:');
$image->Map(image=>$safe, dither=>'True');
$image- > MatteFloodfill(geometry= > , x= > , y= > , matte= > , bordercolor= > , fuzz= > )
MatteFloodfill() changes the transparency value of any pixel that matches matte and is an immediate neighbor. If bordercolor is specified, the transparency value is changed for any neighbor pixel that is not bordercolor. Use Geometry as a shortcut for x + y (e.g. +10+20).
By default matte must match a particular pixel transparency exactly. However, in many cases two transparency values may differ by a small amount. Fuzz defines how much tolerance is acceptable to consider two transparency values as the same. For example, set fuzz to 10 and the opacity values of 100 and 102 respectively are now interpreted as the same value for the purposes of the floodfill.
$image- > MedianFilter(radius= > )
MedianFilter() applies a digital filter that improves the quality of a noisy image. Each pixel is replaced by the median in a set of neighboring pixels as defined by radius.
$image- > Magnify()
Minify() is a convenience method that scales an image proportionally to half its size.
$image- > Modulate(factor= > , brightness= > , saturation= > , hue= > )
Modulate() lets you control the brightness, saturation, and hue of an image. Each parameter is in the form of a percentage relative to 100. For example, to decrease the brightness by 10
$image->Modulate(brightness=$>$90, saturation=$>$150);
Factor represents the brightness, saturation, and hue as one parameter (e.g. 90/150/100).
$image- > Mogrify(method, ...)
The Mogrify() method is convenience function that allows you to call any image manipulation method by giving a method name followed by one or parameters to pass to the method. The following calls have the same result:
$image->Crop('340x256+0+0')
$image->Mogrify('Crop', '340x256+0+0')
$image- > MogrifyRegion(geometry, method, ...)
MogrifyRegion() applies an image manipulation method to a region of the image as defined by . For example if you want to sharpen a 100 x 100 region starting at position (20, 20), use: result:
$image->MogrifyRegion('100x100+20+20', Sharpen, '0x1')
$image- > Montage(background= > , bordercolor= > , borderwidth= > , compose= > , fill= > , font= > , frame= > , geometry= > , gravity= > , label= > , mattecolor= > , mode= > , pointsize= > , shadow= > , stroke= > , texture= > , tile= > , title= > , transparent= > )
The Montage() method is a layout manager that lets you tile one or more thumbnails across an image canvas. Use these parameters to control how the layout manager places the thumbnails:
0000¯1111111111111111¯2222222222222222¯3333333333333333
Over, In Out
Atop Xor Plus
Minus Add Subtract
Difference Bumpmap Copy
Displace
0000¯1111111111111111¯2222222222222222¯3333333333333333
NorthWest, North NorthEast
West Center East
SouthWest South SouthEast
0000¯1111111111111111¯2222222222222222¯3333333333333333 Frame Unframe Concatentate
The default is Frame which adds a simulated three-dimensional border around each thumbnail. Unframe tiles thumbnails without any border or frame, and Concatentate causes each image to be tightly packed without any border, frame, or space between them.
$image- > Mosiac()
The Mosaic() method takes a set of images and inlays them to form a single coherent pictiure. Mosaic() returns a single image with each image in the sequence inlayed in the image canvas at an offset as defined in the image.
$mosaic = $image->Mosaic();
$image- > MotionBlur(geometry= > , radius= > , sigma= > , angle= > )
MotionBlur() simulates motion blur. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and MotionBlur() selects a suitable radius for you. Geometry represents radius x sigma as one parameter (e.g. 0x1). Angle gives the angle of the blurring motion.
$image- > Morph(frames= > )
The Morph() method requires a minimum of two images. The first image is transformed into the second by a number of intervening images as specified by frames. The result is returned as a new image sequence, for example:
$morph = $image->Morph(30);
$image- > Negate(gray= > )
Negate() negates the intensities of each pixel in the image. If gray is a value other than 0, only the grayscale pixels are inverted.
$image = new Image::Magick;
$image = Image::Magick->New()
New() instantiates an image object. As a convenience, you can set any image attribute that Set() knows about. See section for a list of known image attributes. Here is an example:
$image = Image::Magick->New(size=>'160x120');
$image->Read('gray:protein');
$image- > Normalize()
The Normalize() method enhances the contrast of a color image by adjusting the pixels color to span the entire range of colors available.
$image- > OilPaint(radius= > )
OilPaint() applies a special effect filter that simulates an oil painting. Each pixel is replaced by the most frequent color occurring in a circular region defined by radius.
$image- > Opaque(color= > , fill= > , fuzz= > )
Opaque() changes any pixel that matches color with the color defined by fill.
By default color must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. Fuzz defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color.
$image- > OrderedDither()
The OrderedDither() method reduces the image to black and white.
$image- > Ping(filename= > , file= > )
Ping() is a convenience method that returns information about an image without having to read the image into memory. It returns the width, height, file size in bytes, and the file format of the image. For an image sequence, only the information for the first image in the sequence is returned. You can specify more than one filename but only one filehandle:
($width, $height, $size, $format) = $image->Ping('logo.gif');
($width, $height, $size, $format) = $image->Ping(file=>\*IMAGE);
$image- > Profile(filename= > , profile= > )
The Profile() method adds, removes, or applies an image profile. The two most common profiles are ICC, a color management option, and IPTC, a newswire profile. Profile is a Perl variable representing the binary profile information.
$image- > Quantize(colors= > , colorspace= > , dither= > , global_colormap= > measure_error= > , tree_depth= > )
The Quantize() method sets the maximum number of colors in an image. If the number of colors in the image exceeds colors, a color reduction algorithm repeatly merges pixels of similar color until the total number of unique colors is less or equal to the maximum. Here is a description of the color reduction parameters:
0000¯1111111111111111¯2222222222222222¯3333333333333333
CMYK Gray OHTA
RGB sRGB Transparent
XYZ YCbCr YCC
YIQ YPbPr YUV
$image- > QueryColor( ... )
QueryColor() accepts one or more color names and returns their respective red, green, blue, and opacity values:
($red, $green, $blue, $opacity) = $image->QueryColor('red');
$image- > QueryColorName( ... )
QueryColorName() accepts one or more numerical values and returns their respective color name:
$color = $image->QueryColorName('rgba(65535,0,0,0)');
$image- > QueryFontMetrics(font=>, ... )
QueryFontMetrics() accepts a font name and any parameter acceptable to Annotate(). The method returns these attributes associated with the given font:
For example,
@metrics = $image->QueryFontMetrics(font=>'arial.ttf', pointsize=>24);
$image- > Raise(geometry= > , width= > , height= > , raise= > )
Raise() creates a simulated three-dimensional button-like effect by lightening and darkening the edges of the image. Width and height specify the width of the vertical and horizontal edge of the effect. Use Geometry as a shortcut for width and height (e.g. 10x10).
A value other than 0 for raise simulates a raised button-like effect otherwise a sunken button-like effect is applied to the image.
$image- > Read(filename= > , file= > )
The Read() method reads an image or image sequence from one or more filenames or the filehandle you specify. You can specify more than one filename but only one filehandle:
$image->Read(filename=$>$'logo.gif'); # read a single GIF into
# $image object.
$image->Read('logo.jpg', 'button.gif'); # read two images.
$image->Read('*.png'); # read all the PNG files in the
# current directory.
$image->Read(file=$>$\*IMAGE); # read from open Perl filehandle.
Read() returns the number of images that were successfully read.
$image- > ReduceNoise(radius= > )
The ReduceNoise() method smooths the contours of an image while still preserving edge information. The algorithm works by replacing each pixel with its neighbor closest in value. A neighbor is defined by radius. Use a radius of 0 and ReduceNoise() selects a suitable radius for you.
$image- > Resize(geometry= > , width= > , height= > , filter= > , blur= > )
Resize() scales an image to the desired dimensions with one of these filters:
0000¯1111111111111111¯2222222222222222¯3333333333333333
Bessel Blackman Bessel
Catrom Cubic Gaussian
Hanning Hermite Lanczos
Mitchell Point Quadratic
Sinc Triangle
The default is Lanczos.
Use width and height to specify the image size, or use geometry as a shortcut (e.g. 640x480).
Set Blur to a value greater than 1 to blur the image as it is scaled. A value less than 1 sharpens as the image is scaled.
$image- > Roll(geometry= > , x= > , y= > )
Roll() offsets an image as defined by x and y. Geometry represents + x + y as one parameter (e.g. +10+20).
$image- > Rotate(degrees= > , color= > )
Rotate() rotates an image around the x axis by the number of degrees by degrees. Any empty spaces are filled with color.
$image- > Sample(geometry= > , width= > , height= > )
Sample() scales an image to the desired dimensions with pixel sampling. Unlike other scaling methods, this method does not introduce any additional color into the scaled image.
Use width and height to specify the image size, or use geometry as a shortcut (e.g. 640x480).
$image- > Scale(geometry= > , width= > , height= > )
Scale() changes the size of an image to the given dimensions. Use width and height to specify the image size, or use geometry as a shortcut (e.g. 640x480).
$image- > Segment(geometry= > , cluster_threshold= > , smoothing_threshold= > , colorspace= > , verbose= > )
Segment() segments an image by by analyzing the histograms of the color components and identifying units that are homogeneous. The default value for cluster_threshold is 1.0 and smoothing_threshold is 1.5. This can be represented with a shortcut geometry of 1.0x1.5.
$image- > Set(, ...)
Set() accepts one or more image attributes listed in section 22.1 and sets their value.
$image- > Shade(geometry= > , azimuth= > , elevation= > , color= > )
Shade() shines a distant light on an image to create a three-dimensional effect. You control the positioning of the light with and ; azimuth is measured in degrees off the x axis and elevation is measured in pixels above the Z axis. The geometry parameter is a shortcut for azimuth x elevation (e.g. 30x30).
$image- > Sharpen(geometry= > , radius= > , sigma= > )
Sharpen() sharpens an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and Sharpen() selects a suitable radius for you. Geometry represents radius x sigma as one parameter (e.g. 0x1).
$image- > Shear(geometry= > , x= > , y= > , color= > )
Shear() transforms an image by shearing it along the x or y axis. The x and y parameters specify the degree of shear and ranges from -179.9 to 179.9. Geometry represents x x y as one parameter (e.g. 30x60). Any empty spaces created when shearing are filled with color.
$image- > Signature()
Signature() generates an MD5 digital signature. The signature can later be used to verify the color integrity of the image. Two images with the same signature are identical.
$image- > Solarize(threshold= > )
Solarize() applies a special effect to the image, similar to the effect achieved in a photo darkroom by selectively exposing areas of photo sensitive paper to light. Threshold ranges from 0 to MaxRGB and is a measure of the extent of the solarization.
$image- > Spread(amount= > )
Spead() is a special effects method that randomly displaces each pixel in a block defined by the amount parameter.
$image- > Stereo(image= > )
Stereo() combines two images and produces a single image that is the composite of a left and right image of a stereo pair. Special red-green stereo glasses are required to view this effect.
$image- > Stegano(image= > , offset= > )
Use Stegano() to hide a digital watermark within the image. Recover the hidden watermark later to prove that the authenticity of an image. textttOffset defines the start position within the image to hide the watermark.
$image- > Swirl(degrees= > )
The Swirl() method swirls the pixels about the center of the image, where degrees indicates the sweep of the arc through which each pixel is moved. You get a more dramatic effect as the degrees move from 1 to 360.
$image- > Texture(texture= > )
Texture() repeatedly tiles the texture image across and down the image canvas.
$image- > Threshold(threshold= > )
Threshold() changes the value of individual pixels based on the intensity of each pixel compared to threshold. The result is a high-contrast, two color image.
$image- > Transform(geometry= > , crop= > )
Transform() behaves like Resize() or Crop() but rather than acting on the image, it returns a new image handle:
$slices = $image->Transform(crop=>'100x100')
$image- > Transparent(color= > , opacity= > fuzz= > )
Transparent() changes the opacity value associated with any pixel that matches color to the value defined by opacity.
By default color must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. Fuzz defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color.
$image- > Trim(fuzz= > )
Trim() crops a rectangular box around the image to remove edges that are the background color.
By default the edge pixels must match in color exactly to be trimmed. However, in many cases two colors may differ by a small amount. Fuzz defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color.
$image- > UnsharpMask(geometry= > , radius= > , sigma= > , amount= > , threshold= > )
UnsharpMask() sharpens an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and UnsharpMask() selects a suitable radius for you. Geometry represents radius x sigma as one parameter (e.g. 0x1).
$image- > Wave(geometry= > , amplitude= > , wavelength= > )
The Wave() filter creates a "ripple" effect in the image by shifting the pixels vertically along a sine wave whose amplitude and wavelength is specified by the given parameters. Geometry represents amplitude x wavelength as one parameter (e.g. 30x30).
$image- > Write(filename= > , file= > )
Write() allows you to write a single or image or a sequence to a file or filehandle. You can specify more than one filename but only one filehandle:
$image->Write(filename=>'logo.gif'); # write a single GIF image.
$image->Write('logo.jpg', 'button.gif'); # write two images.
$image->Write('gif:-'); # write to STDOUT.
$image->[0]->Write('logo.png'); # write only first image
# in a sequence.
$image->Write(file=>\*IMAGE); # write to a open Perl filehandle.
Write() returns the number of images that were written.
Most Image::Magick methods return an undefined value if the operation was successful. When an error occurs, a message is returned with an embedded numeric status code. Look up the status code in table to determine the reason the operation failed. The mnemonics are aliases for the the corresponding numeric codes.
Error and Warning Codes | ||
Code | Mnemonic | Description |
Error and Warning Codes (continued) | ||
Code | Mnemonic | Description |
0 | Success | Method completed without an error or warning. |
300 | ResourceLimitWarning | A program resource is exhausted (e.g. not enough memory). |
305 | XServerWarning | An X resource is unavailable. |
310 | OptionWarning | An option parameter was malformed. |
315 | DelegateWarning | An ImageMagick delegate returned a warning. |
320 | MissingDelegateWarning | The image type can not be read or written because the required delegate is missing. |
325 | CorruptImageWarning | The image file may be corrupt. |
330 | FileOpenWarning | The image file could not be opened. |
335 | BlobWarning | A Binary Large OBject could not be allocated. |
340 | CacheWarning | Pixels could not be saved to the pixel cache. |
400 | ResourceLimitError | A program resource is exhausted (e.g. not enough memory). |
405 | XServerError | An X resource is unavailable. |
410 | OptionError | An option parameter was malformed. |
415 | DelegateError | An ImageMagick delegate returned a warning. |
420 | MissingDelegateError | The image type can not be read or written because the required delegate is missing. |
425 | CorruptImageError | The image file may be corrupt. |
430 | FileOpenError | The image file could not be opened. |
435 | BlobError | A Binary Large OBject could not be allocated. |
440 | CacheError | Pixels could not be saved to the pixel cache. |
ImageMagick Colors | ||||
Color | Name | Color | Name | |
ImageMagick Colors (continued) | ||||
Color | Name | Color | Name | |
aliceblue | rgba(240, 248, 255, 0) | gray71 | rgba(181, 181, 181, 0) | |
antiquewhite | rgba(250, 235, 215, 0) | gray72 | rgba(184, 184, 184, 0) | |
aqua | rgba(0, 255, 255, 0) | gray73 | rgba(186, 186, 186, 0) | |
aquamarine | rgba(127, 255, 212, 0) | gray74 | rgba(189, 189, 189, 0) | |
azure | rgba(240, 255, 255, 0) | gray75 | rgba(191, 191, 191, 0) | |
beige | rgba(245, 245, 220, 0) | gray76 | rgba(194, 194, 194, 0) | |
bisque | rgba(255, 228, 196, 0) | gray77 | rgba(196, 196, 196, 0) | |
black | rgba(0, 0, 0, 0) | gray78 | rgba(199, 199, 199, 0) | |
blanchedalmond | rgba(255, 235, 205, 0) | gray79 | rgba(201, 201, 201, 0) | |
blue | rgba(0, 0, 255, 0) | gray8 | rgba(20, 20, 20, 0) | |
blueviolet | rgba(138, 43, 226, 0) | gray80 | rgba(204, 204, 204, 0) | |
brown | rgba(165, 42, 42, 0) | gray81 | rgba(207, 207, 207, 0) | |
burlywood | rgba(222, 184, 135, 0) | gray82 | rgba(209, 209, 209, 0) | |
cadetblue | rgba(95, 158, 160, 0) | gray83 | rgba(212, 212, 212, 0) | |
chartreuse | rgba(127, 255, 0, 0) | gray84 | rgba(214, 214, 214, 0) | |
chocolate | rgba(210, 105, 30, 0) | gray85 | rgba(217, 217, 217, 0) | |
coral | rgba(255, 127, 80, 0) | gray86 | rgba(219, 219, 219, 0) | |
cornflowerblue | rgba(100, 149, 237, 0) | gray87 | rgba(222, 222, 222, 0) | |
cornsilk | rgba(255, 248, 220, 0) | gray88 | rgba(224, 224, 224, 0) | |
crimson | rgba(220, 20, 60, 0) | gray89 | rgba(227, 227, 227, 0) | |
cyan | rgba(0, 255, 255, 0) | gray9 | rgba(23, 23, 23, 0) | |
darkblue | rgba(0, 0, 139, 0) | gray90 | rgba(229, 229, 229, 0) | |
darkcyan | rgba(0, 139, 139, 0) | gray91 | rgba(232, 232, 232, 0) | |
darkgoldenrod | rgba(184, 134, 11, 0) | gray92 | rgba(235, 235, 235, 0) | |
darkgray | rgba(169, 169, 169, 0) | gray93 | rgba(237, 237, 237, 0) | |
darkgreen | rgba(0, 100, 0, 0) | gray94 | rgba(240, 240, 240, 0) | |
darkgrey | rgba(169, 169, 169, 0) | gray95 | rgba(242, 242, 242, 0) | |
darkkhaki | rgba(189, 183, 107, 0) | gray96 | rgba(245, 245, 245, 0) | |
darkmagenta | rgba(139, 0, 139, 0) | gray97 | rgba(247, 247, 247, 0) | |
darkolivegreen | rgba(85, 107, 47, 0) | gray98 | rgba(250, 250, 250, 0) | |
darkorange | rgba(255, 140, 0, 0) | gray99 | rgba(252, 252, 252, 0) | |
darkorchid | rgba(153, 50, 204, 0) | green | rgba(0, 128, 0, 0) | |
darkred | rgba(139, 0, 0, 0) | greenyellow | rgba(173, 255, 47, 0) | |
darksalmon | rgba(233, 150, 122, 0) | grey | rgba(128, 128, 128, 0) | |
darkseagreen | rgba(143, 188, 143, 0) | honeydew | rgba(240, 255, 240, 0) | |
darkslateblue | rgba(72, 61, 139, 0) | hotpink | rgba(255, 105, 180, 0) | |
darkslategray | rgba(47, 79, 79, 0) | indianred | rgba(205, 92, 92, 0) | |
darkslategrey | rgba(47, 79, 79, 0) | indigo | rgba(75, 0, 130, 0) | |
darkturquoise | rgba(0, 206, 209, 0) | ivory | rgba(255, 255, 240, 0) | |
darkviolet | rgba(148, 0, 211, 0) | khaki | rgba(240, 230, 140, 0) | |
deeppink | rgba(255, 20, 147, 0) | lavender | rgba(230, 230, 250, 0) | |
deepskyblue | rgba(0, 191, 255, 0) | lavenderblush | rgba(255, 240, 245, 0) | |
dimgray | rgba(105, 105, 105, 0) | lawngreen | rgba(124, 252, 0, 0) | |
dimgrey | rgba(105, 105, 105, 0) | lemonchiffon | rgba(255, 250, 205, 0) | |
dodgerblue | rgba(30, 144, 255, 0) | lightblue | rgba(173, 216, 230, 0) | |
firebrick | rgba(178, 34, 34, 0) | lightcoral | rgba(240, 128, 128, 0) | |
floralwhite | rgba(255, 250, 240, 0) | lightcyan | rgba(224, 255, 255, 0) | |
forestgreen | rgba(34, 139, 34, 0) | lightgoldenrodyellow | rgba(250, 250, 210, 0) | |
fractal | rgba(128, 128, 128, 0) | lightgray | rgba(211, 211, 211, 0) | |
fuchsia | rgba(255, 0, 255, 0) | lightgreen | rgba(144, 238, 144, 0) | |
gainsboro | rgba(220, 220, 220, 0) | lightgrey | rgba(211, 211, 211, 0) | |
ghostwhite | rgba(248, 248, 255, 0) | lightpink | rgba(255, 182, 193, 0) | |
gold | rgba(255, 215, 0, 0) | lightsalmon | rgba(255, 160, 122, 0) | |
goldenrod | rgba(218, 165, 32, 0) | lightseagreen | rgba(32, 178, 170, 0) | |
gray | rgba(126, 126, 126, 0) | lightskyblue | rgba(135, 206, 250, 0) | |
gray0 | rgba(0, 0, 0, 0) | lightslategray | rgba(119, 136, 153, 0) | |
gray1 | rgba(3, 3, 3, 0) | lightslategrey | rgba(119, 136, 153, 0) | |
gray10 | rgba(26, 26, 26, 0) | lightsteelblue | rgba(176, 196, 222, 0) | |
gray100 | rgba(255, 255, 255, 0) | lightyellow | rgba(255, 255, 224, 0) | |
gray11 | rgba(28, 28, 28, 0) | lime | rgba(0, 255, 0, 0) | |
gray12 | rgba(31, 31, 31, 0) | limegreen | rgba(50, 205, 50, 0) | |
gray13 | rgba(33, 33, 33, 0) | linen | rgba(250, 240, 230, 0) | |
gray14 | rgba(36, 36, 36, 0) | magenta | rgba(255, 0, 255, 0) | |
gray15 | rgba(38, 38, 38, 0) | maroon | rgba(128, 0, 0, 0) | |
gray16 | rgba(41, 41, 41, 0) | mediumaquamarine | rgba(102, 205, 170, 0) | |
gray17 | rgba(43, 43, 43, 0) | mediumblue | rgba(0, 0, 205, 0) | |
gray18 | rgba(46, 46, 46, 0) | mediumorchid | rgba(186, 85, 211, 0) | |
gray19 | rgba(48, 48, 48, 0) | mediumpurple | rgba(147, 112, 219, 0) | |
gray2 | rgba(5, 5, 5, 0) | mediumseagreen | rgba(60, 179, 113, 0) | |
gray20 | rgba(51, 51, 51, 0) | mediumslateblue | rgba(123, 104, 238, 0) | |
gray21 | rgba(54, 54, 54, 0) | mediumspringgreen | rgba(0, 250, 154, 0) | |
gray22 | rgba(56, 56, 56, 0) | mediumturquoise | rgba(72, 209, 204, 0) | |
gray23 | rgba(59, 59, 59, 0) | mediumvioletred | rgba(199, 21, 133, 0) | |
gray24 | rgba(61, 61, 61, 0) | midnightblue | rgba(25, 25, 112, 0) | |
gray25 | rgba(64, 64, 64, 0) | mintcream | rgba(245, 255, 250, 0) | |
gray26 | rgba(66, 66, 66, 0) | mistyrose | rgba(255, 228, 225, 0) | |
gray27 | rgba(69, 69, 69, 0) | moccasin | rgba(255, 228, 181, 0) | |
gray28 | rgba(71, 71, 71, 0) | navajowhite | rgba(255, 222, 173, 0) | |
gray29 | rgba(74, 74, 74, 0) | navy | rgba(0, 0, 128, 0) | |
gray3 | rgba(8, 8, 8, 0) | none | rgba(0, 0, 0, 255) | |
gray30 | rgba(77, 77, 77, 0) | oldlace | rgba(253, 245, 230, 0) | |
gray31 | rgba(79, 79, 79, 0) | olive | rgba(128, 128, 0, 0) | |
gray32 | rgba(82, 82, 82, 0) | olivedrab | rgba(107, 142, 35, 0) | |
gray33 | rgba(84, 84, 84, 0) | orange | rgba(255, 165, 0, 0) | |
gray34 | rgba(87, 87, 87, 0) | orangered | rgba(255, 69, 0, 0) | |
gray35 | rgba(89, 89, 89, 0) | orchid | rgba(218, 112, 214, 0) | |
gray36 | rgba(92, 92, 92, 0) | palegoldenrod | rgba(238, 232, 170, 0) | |
gray37 | rgba(94, 94, 94, 0) | palegreen | rgba(152, 251, 152, 0) | |
gray38 | rgba(97, 97, 97, 0) | paleturquoise | rgba(175, 238, 238, 0) | |
gray39 | rgba(99, 99, 99, 0) | palevioletred | rgba(219, 112, 147, 0) | |
gray4 | rgba(10, 10, 10, 0) | papayawhip | rgba(255, 239, 213, 0) | |
gray40 | rgba(102, 102, 102, 0) | peachpuff | rgba(255, 218, 185, 0) | |
gray41 | rgba(105, 105, 105, 0) | peru | rgba(205, 133, 63, 0) | |
gray42 | rgba(107, 107, 107, 0) | pink | rgba(255, 192, 203, 0) | |
gray43 | rgba(110, 110, 110, 0) | plum | rgba(221, 160, 221, 0) | |
gray44 | rgba(112, 112, 112, 0) | powderblue | rgba(176, 224, 230, 0) | |
gray45 | rgba(115, 115, 115, 0) | purple | rgba(128, 0, 128, 0) | |
gray46 | rgba(117, 117, 117, 0) | red | rgba(255, 0, 0, 0) | |
gray47 | rgba(120, 120, 120, 0) | rosybrown | rgba(188, 143, 143, 0) | |
gray48 | rgba(122, 122, 122, 0) | royalblue | rgba(65, 105, 225, 0) | |
gray49 | rgba(125, 125, 125, 0) | saddlebrown | rgba(139, 69, 19, 0) | |
gray5 | rgba(13, 13, 13, 0) | salmon | rgba(250, 128, 114, 0) | |
gray50 | rgba(127, 127, 127, 0) | sandybrown | rgba(244, 164, 96, 0) | |
gray51 | rgba(130, 130, 130, 0) | seagreen | rgba(46, 139, 87, 0) | |
gray52 | rgba(133, 133, 133, 0) | seashell | rgba(255, 245, 238, 0) | |
gray53 | rgba(135, 135, 135, 0) | sienna | rgba(160, 82, 45, 0) | |
gray54 | rgba(138, 138, 138, 0) | silver | rgba(192, 192, 192, 0) | |
gray55 | rgba(140, 140, 140, 0) | skyblue | rgba(135, 206, 235, 0) | |
gray56 | rgba(143, 143, 143, 0) | slateblue | rgba(106, 90, 205, 0) | |
gray57 | rgba(145, 145, 145, 0) | slategray | rgba(112, 128, 144, 0) | |
gray58 | rgba(148, 148, 148, 0) | slategrey | rgba(112, 128, 144, 0) | |
gray59 | rgba(150, 150, 150, 0) | snow | rgba(255, 250, 250, 0) | |
gray6 | rgba(15, 15, 15, 0) | springgreen | rgba(0, 255, 127, 0) | |
gray60 | rgba(153, 153, 153, 0) | steelblue | rgba(70, 130, 180, 0) | |
gray61 | rgba(156, 156, 156, 0) | tan | rgba(210, 180, 140, 0) | |
gray62 | rgba(158, 158, 158, 0) | teal | rgba(0, 128, 128, 0) | |
gray63 | rgba(161, 161, 161, 0) | thistle | rgba(216, 191, 216, 0) | |
gray64 | rgba(163, 163, 163, 0) | tomato | rgba(255, 99, 71, 0) | |
gray65 | rgba(166, 166, 166, 0) | turquoise | rgba(64, 224, 208, 0) | |
gray66 | rgba(168, 168, 168, 0) | violet | rgba(238, 130, 238, 0) | |
gray67 | rgba(171, 171, 171, 0) | wheat | rgba(245, 222, 179, 0) | |
gray68 | rgba(173, 173, 173, 0) | white | rgba(255, 255, 255, 0) | |
gray69 | rgba(176, 176, 176, 0) | whitesmoke | rgba(245, 245, 245, 0) | |
gray7 | rgba(18, 18, 18, 0) | yellow | rgba(255, 255, 0, 0) | |
gray70 | rgba(179, 179, 179, 0) | yellowgreen | rgba(154, 205, 50, 0) | |
gray71 | rgba(181, 181, 181, 0) | |||