Image

The image

class Image {}

Constructors

this
this()
this
this(MagickCoreImage* image, Options options)
Undocumented in source.
this
this(ImageRef image, Options options)
Undocumented in source.
this
this(string filename, string magick)

Construct an Image by reading from the file or URL specified by filename.

this
this(string filename)

Construct an Image by reading from the file or URL specified by filename.

this
this(Geometry size, Color color)

Construct a blank image with the specified color.

this
this(void[] blob, string magick)

Construct an image from an in-memory blob. The Blob size, depth and magick format may also be specified.

this
this(void[] blob)
Undocumented in source.
this
this(void[] blob, Geometry size)
this(void[] blob, Geometry size, size_t depth)
this(void[] blob, Geometry size, size_t depth, string magick)
this(void[] blob, Geometry size, string magick)

Construct an image from an in-memory blob. The Blob size, depth and magick format may also be specified.

this
this(size_t columns, size_t rows, string map, StorageType storage, void[] pixels)

Constructs an image from an array of pixels.

Members

Aliases

ImageRef
alias ImageRef = RefCounted!(DestroyImage, MagickCoreImage)
Undocumented in source.
MagickCoreImage
alias MagickCoreImage = dmagick.c.image.Image
Undocumented in source.
radialBlur
alias radialBlur = rotationalBlur

Applies a rotational blur to the image.

Functions

adaptiveBlur
void adaptiveBlur(double radius, double sigma, ChannelType channel)

Adaptively blurs the image by blurring more intensely near image edges and less intensely far from edges. The adaptiveBlur method blurs 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 adaptiveBlur selects a suitable radius for you.

adaptiveResize
void adaptiveResize(Geometry size)

adaptiveResize uses the special Mesh Interpolation method to resize images. Basically adaptiveResize avoids the excessive blurring that resize can produce with sharp color changes. This works well for slight image size adjustments and in particularly for magnification, And especially with images with sharp color changes. But when images are enlarged or reduced by more than 50% it will start to produce aliasing, and Moiré effects in the results.

adaptiveSharpen
void adaptiveSharpen(double radius, double sigma, ChannelType channel)

Adaptively sharpens the image by sharpening more intensely near image edges and less intensely far from edges. The adaptiveSharpen method sharpens 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 adaptiveSharpen selects a suitable radius for you.

adaptiveThreshold
void adaptiveThreshold(size_t width, size_t height, ssize_t offset)

Selects an individual threshold for each pixel based on the range of intensity values in its local neighborhood. This allows for thresholding of an image whose global intensity histogram doesn't contain distinctive peaks.

addNoise
void addNoise(NoiseType type, ChannelType channel)

Adds random noise to the specified channel or channels in the image. The amount of time addNoise requires depends on the NoiseType argument.

affineTransform
void affineTransform(AffineMatrix affine)

Transforms the image as specified by the affine matrix.

alpha
void alpha(AlphaChannelType type)
bool alpha()

Set a flag to indicate whether or not to use alpha channel data.

animationDelay
void animationDelay(Duration delay)
Duration animationDelay()

Number time which must expire before displaying the next image in an animated sequence.

animationIterations
void animationIterations(size_t iterations)
size_t animationIterations()

Number of iterations to loop an animation.

annotate
void annotate(string text, size_t xOffset, size_t yOffset, GravityType gravity, double degrees)

Annotates an image with text. Optionally you can include any of the following bits of information about the image by embedding the appropriate special characters:

annotate
void annotate(string text, Geometry boundingArea, GravityType gravity, double degrees)

Ditto, but word wraps the text so it stays withing the boundingArea. if the height and width are 0 the height and with of the image are used to calculate the bounding area.

autoGamma
void autoGamma(ChannelType channel)

extract the 'mean' from the image and adjust the image to try make set its gamma appropriatally.

autoLevel
void autoLevel(ChannelType channel)

adjusts the levels of a particular image channel by scaling the minimum and maximum values to the full quantum range.

autoOrient
void autoOrient()

Adjusts an image so that its orientation is suitable for viewing (i.e. top-left orientation). Note that only some models of modern digital cameras can tag an image with the orientation.

backgroundColor
void backgroundColor(string color)
void backgroundColor(Color color)
Color backgroundColor()

Set the image background color. The default is "white".

bilevel
void bilevel(Quantum threshold, ChannelType channel)

Changes the value of individual pixels based on the intensity of each pixel channel. The result is a high-contrast image.

blackThreshold
void blackThreshold(Quantum threshold, ChannelType channel)
void blackThreshold(Quantum red, Quantum green, Quantum blue, Quantum opacity, ChannelType channel)

Forces all pixels below the threshold into black while leaving all pixels above the threshold unchanged.

blend
void blend(const(Image) overlay, int srcPercentage, int dstPercentage, ssize_t xOffset, ssize_t yOffset)
void blend(const(Image) overlay, int srcPercentage, int dstPercentage, GravityType gravity)

Adds the overlay image to the target image according to srcPercent and dstPercent.

blueShift
void blueShift(double factor)

mutes the colors of the image to simulate a scene at nighttime in the moonlight.

blur
void blur(double radius, double sigma, ChannelType channel)

Blurs the specified channel. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). The blur method differs from gaussianBlur in that it uses a separable kernel which is faster but mathematically equivalent to the non-separable kernel.

border
void border(size_t width, size_t height)

Surrounds the image with a border of the color defined by the borderColor property.

borderColor
void borderColor(string color)
void borderColor(Color color)
Color borderColor()

Set the image border color. The default is "#dfdfdf".

boundingBox
Geometry boundingBox()

Return smallest bounding box enclosing non-border pixels. The current fuzz value is used when discriminating between pixels.

changed
bool changed()

returns true if any pixel in the image has been altered since it was first constituted.

channel
Image channel(ChannelType channel)

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

channelDepth
void channelDepth(ChannelType channel, size_t depth)
size_t channelDepth(ChannelType channel)

Channel modulus depth. The channel modulus depth represents the minimum number of bits required to support the channel without loss. Setting the channel's modulus depth modifies the channel (i.e. discards resolution) if the requested modulus depth is less than the current modulus depth, otherwise the channel is not altered. There is no attribute associated with the modulus depth so the current modulus depth is obtained by inspecting the pixels. As a result, the depth returned may be less than the most recently set channel depth. Subsequent image processing may result in increasing the channel depth.

charcoal
void charcoal(double radius, double sigma)

Adds a "charcoal" effect to the image. You can alter the intensity of the effect by changing the radius and sigma arguments.

chop
void chop(Geometry geometry)

Removes the specified rectangle and collapses the rest of the image to fill the removed portion.

chromaticity
void chromaticity(ChromaticityInfo chroma)
ChromaticityInfo chromaticity()

The red, green, blue, and white-point chromaticity values.

classType
void classType(ClassType type)
ClassType classType()

The image's storage class. If DirectClass then the pixels contain valid RGB or CMYK colors. If PseudoClass then the image has a colormap referenced by the pixel's index member.

clipMask
void clipMask(const(Image) image)
Image clipMask()

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

clone
Image clone()

Returns a copy of the image.

clut
void clut(Image clutImage, ChannelType channel)

replaces each color value in the given image, by using it as an index to lookup a replacement color value in a Color Look UP Table in the form of an image. The values are extracted along a diagonal of the CLUT image so either a horizontal or vertial gradient image can be used.

colorDecisionList
void colorDecisionList(string colorCorrectionCollection)

Applies a lightweight Color Correction Collection (CCC) file to the image. The file solely contains one or more color corrections. Here is a sample:

colorMatrix
void colorMatrix(double[][] matrix)

Applies color transformation to an image. This method permits saturation changes, hue rotation, luminance to alpha, and various other effects. Although variable-sized transformation matrices can be used, typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA (or RGBA with offsets). The matrix is similar to those used by Adobe Flash except offsets are in column 6 rather than 5 (in support of CMYKA images) and offsets are normalized (divide Flash offset by 255)

colorize
void colorize(Color fill, uint opacityRed, uint opacityGreen, uint opacityBlue, uint opacityAlpha)

Blend the fill color with the image pixels. The opacityRed, opacityGreen, opacityBlue and opacityAlpha arguments are the percentage to blend with the red, green, blue and alpha channels.

colormap
auto colormap()

Access the image color map. Only ClassType.PsseudoClass images have a colormap.

colormapSize
void colormapSize(size_t size)
size_t colormapSize()

The number of colors in the colormap. Only meaningful for PseudoClass images.

colorspace
ColorspaceType colorspace()

The colorspace used to represent the image pixel colors. Image pixels are always stored as RGB(A) except for the case of CMY(K).

colorspace
void colorspace(ColorspaceType type)

The colorspace used to represent the image pixel colors. Image pixels are always stored as RGB(A) except for the case of CMY(K).

columns
size_t columns()

The width of the image in pixels.

compare
bool compare(const(Image) referenceImage)

Compare current image with another image. Sets meanErrorPerPixel, normalizedMaxError , and normalizedMeanError in the current image. false is returned if the images are identical. An ErrorOption exception is thrown if the reference image columns, rows, colorspace, or matte differ from the current image.

compose
CompositeOperator compose()

Composition operator to be used when composition is implicitly used (such as for image flattening).

compose
void compose(CompositeOperator op)

Composition operator to be used when composition is implicitly used (such as for image flattening).

composite
void composite(const(Image) overlay, CompositeOperator compositeOp, ssize_t xOffset, ssize_t yOffset, ChannelType channel)
void composite(const(Image) overlay, CompositeOperator compositeOp, GravityType gravity, ChannelType channel)

Composites dest onto this image using the specified composite operator.

composite
void composite(const(Image) overlay, double a, double b, double c, double d, ssize_t xOffset, ssize_t yOffset, ChannelType channel)
void composite(const(Image) overlay, double a, double b, double c, double d, GravityType gravity, ChannelType channel)

Merge the source and destination images according to the formula a*Sc*Dc + b*Sc + c*Dc + d where Sc is the source pixel and Dc is the destination pixel.

compositeTiled
void compositeTiled(const(Image) overlay, CompositeOperator compositeOp, ChannelType channel)

Composites multiple copies of the source image across and down the image, producing the same results as ImageMagick's composite command with the -tile option.

compression
CompressionType compression()

The image compression type. The default is the compression type of the specified image file.

compression
void compression(CompressionType type)

The image compression type. The default is the compression type of the specified image file.

contrast
void contrast(bool sharpen)

enhances the intensity differences between the lighter and darker elements of the image.

contrastStretch
void contrastStretch(double blackPoint, double whitePoint, ChannelType channel)

This is a simple image enhancement technique that attempts to improve the contrast in an image by `stretching' the range of intensity values it contains to span a desired range of values. It differs from the more sophisticated histogram equalization in that it can only apply a linear scaling function to the image pixel values. As a result the `enhancement' is less harsh.

convolve
void convolve(double[][] matrix, ChannelType channel)

Applies a custom convolution kernel to the image.

crop
void crop(Geometry geometry)

Extract a region of the image starting at the offset defined by geometry. Region must be fully defined, and no special handling of geometry flags is performed.

cycleColormap
void cycleColormap(ssize_t amount)

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.

decipher
void decipher(string passphrase)

Decipher an enciphered image.

density
Geometry density()

The vertical and horizontal resolution in pixels of the image. This option specifies an image density when decoding a Postscript or Portable Document page.

density
void density(Geometry value)

The vertical and horizontal resolution in pixels of the image. This option specifies an image density when decoding a Postscript or Portable Document page.

depth
size_t depth()

Image depth. Used to specify the bit depth when reading or writing raw images or when the output format supports multiple depths. Defaults to the quantum depth that ImageMagick is compiled with.

depth
void depth(size_t value)

Image depth. Used to specify the bit depth when reading or writing raw images or when the output format supports multiple depths. Defaults to the quantum depth that ImageMagick is compiled with.

deskew
void deskew(double threshold, size_t autoCropWidth)

Straightens an image. A threshold of 40% works for most images.

despeckle
void despeckle()

Reduces the speckle noise in an image while perserving the edges of the original image.

directory
string directory()

Tile names from within an image montage. Only valid after calling montage or reading a MIFF file which contains a directory.

displace
void displace(const(Image) displacementMap, int xAmplitude, int yAmplitude, ssize_t xOffset, ssize_t yOffset)
void displace(const(Image) overlay, int srcPercentage, int dstPercentage, GravityType gravity)

Uses displacementMap to move color from img to the output image.

display
void display()

Display image on screen.

dissolve
void dissolve(const(Image) overlay, int srcPercentage, int dstPercentage, ssize_t xOffset, ssize_t yOffset)
void dissolve(const(Image) overlay, int srcPercentage, int dstPercentage, GravityType gravity)

Composites the overlay image onto this image. The opacity of this image is multiplied by dstPercentage and opacity of overlay is multiplied by srcPercentage.

distort
void distort(DistortImageMethod method, double[] arguments, bool bestfit)

Distort an image using the specified distortion type and its required arguments. This method is equivalent to ImageMagick's -distort option.

edge
void edge(double radius)

Finds edges in an image.

emboss
void emboss(double radius, double sigma)

Emboss image (hilight edges with 3D effect).

encipher
void encipher(string passphrase)

Encipher an image.

endian
EndianType endian()

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

endian
void endian(EndianType type)

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

enhance
void enhance()

Applies a digital filter that improves the quality of a noisy image.

equalize
void equalize(ChannelType channel)

Applies a histogram equalization to the image.

erase
void erase()

Initializes the image pixels to the image background color.

evaluate
void evaluate(MagickEvaluateOperator op, double value, ChannelType channel)

Applies a value to the image with an arithmetic, relational, or logical operator to an image. Use these operations to lighten or darken an image, to increase or decrease contrast in an image, or to produce the "negative" of an image.

excerpt
void excerpt(Geometry geometry)

This method is very similar to crop. It extracts the rectangle specified by its arguments from the image and returns it as a new image. However, excerpt does not respect the virtual page offset and does not update the page offset and is more efficient than cropping.

exifProfile
void[] exifProfile()

The EXIF profile.

exifProfile
void exifProfile(void[] blob)

The EXIF profile.

exportPixels
T[] exportPixels(Geometry area, string map)

Extracts the pixel data from the specified rectangle.

exportPixels
void exportPixels(Geometry area, T[] pixels, string map)

Ditto, but takes an existing pixel buffer.

extent
void extent(Geometry geometry)

If the Geometry is larger than this Image, extends the image to the specified geometry. And the new pixels are set to the background color. If the Geometry is smaller than this image crops the image.

fileSize
MagickSizeType fileSize()

The image filesize in bytes.

filename
string filename()

The image filename.

filename
void filename(string str)

The image filename.

filter
FilterTypes filter()

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.

filter
void filter(FilterTypes type)

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.

findSimilarRegion
Geometry findSimilarRegion(Image target, ssize_t xOffset, ssize_t yOffset)

This interesting method searches for a rectangle in the image that is similar to the target. For the rectangle to be similar each pixel in the rectangle must match the corresponding pixel in the target image within the range specified by the fuzz property of this image and the target image.

flip
void flip()

creates a vertical mirror image by reflecting the pixels around the central x-axis.

floodFill
void floodFill(ssize_t xOffset, ssize_t yOffset, bool fillToBorder, ChannelType channel)

Changes the color value of any pixel that matches target and is an immediate neighbor. To the fillColor or fillPattern set for this image. If fillToBorder is true, the color value is changed for any neighbor pixel that does not match the borderColor.

floodFillColor
void floodFillColor(ssize_t xOffset, ssize_t yOffset, Color fillColor, Color borderColor, ChannelType channel)

Fill the image like floodFill but use the specified colors.

floodFillPattern
void floodFillPattern(ssize_t xOffset, ssize_t yOffset, Image fillPattern, Color borderColor, ChannelType channel)

Fill the image like floodFill but use the specified pattern an borderColor.

flop
void flop()

creates a horizontal mirror image by reflecting the pixels around the central y-axis.

format
string format()

The image encoding format. For example, "GIF" or "PNG".

frame
void frame(Geometry geometry)

Adds a simulated 3D border. The matteColor is used to draw the frame.

functionImage
void functionImage(MagickFunction funct, double[] params, ChannelType channel)

Applies a value to the image with an arithmetic, relational, or logical operator to an image. Use these operations to lighten or darken an image, to increase or decrease contrast in an image, or to produce the "negative" of an image.

fuzz
double fuzz()

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.

fuzz
void fuzz(double f)

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.

fx
void fx(string expression, ChannelType channel)

Applies a mathematical expression to the specified image.

gamma
void gamma(double value, ChannelType channel)
void gamma(double red, double green, double blue)

gamma gamma-corrects a particular image channel. 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 function. Values typically range from 0.8 to 2.3.

gamma
double gamma()

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.

gaussianBlur
void gaussianBlur(double radius, double sigma, ChannelType channel)

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.

geometry
void geometry(Geometry value)
Geometry geometry()

Preferred size of the image when encoding.

geometry
void geometry(string str)

Preferred size of the image when encoding.

getTypeMetrics
TypeMetric getTypeMetrics(string text)

Returns the TypeMetric class witch provides the information regarding font metrics such as ascent, descent, text width, text height, and maximum horizontal advance. The units of these font metrics are in pixels, and that the metrics are dependent on the current Image font (default Ghostscript's "Helvetica"), pointsize (default 12 points), and x/y resolution (default 72 DPI) settings.

gifDisposeMethod
void gifDisposeMethod(DisposeType type)
DisposeType gifDisposeMethod()

GIF disposal method. This attribute is used to control how successive images are rendered (how the preceding image is disposed of) when creating a GIF animation.

gray
bool gray()

Returns true if all the pixels in the image have the same red, green, and blue intensities.

haldClut
void haldClut(Image haldImage, ChannelType channel)

applies a Hald color lookup table to the image. A Hald color lookup table is a 3-dimensional color cube mapped to 2 dimensions. Create it with the HALD coder. You can apply any color transformation to the Hald image and then use this method to apply the transform to the image.

histogram
MagickSizeType[Color] histogram()

Computes the number of times each unique color appears in the image. You may want to quantize the image before using this property.

iccColorProfile
void iccColorProfile(void[] blob)
void[] iccColorProfile()

ICC color profile.

implode
void implode(double amount)

A funhouse mirror effect.

importPixels
void importPixels(Geometry area, T[] pixels, string map)

Replaces the pixels in the specified area with pixel data from the supplied array.

interlace
void interlace(InterlaceType type)
InterlaceType interlace()

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. The default is NoInterlace.

iptcProfile
void iptcProfile(void[] blob)
void[] iptcProfile()

The International Press Telecommunications Council profile.

level
void level(Quantum blackPoint, Quantum whitePoint, double gamma, ChannelType channel)

Adjusts the levels of an image by scaling the colors falling between specified white and black points to the full available quantum range. The parameters provided represent the black, mid, and white points. Colors darker than the black point are set to zero. Colors brighter than the white point are set to the maximum quantum value.

levelize
void levelize(Quantum blackPoint, Quantum whitePoint, double gamma, ChannelType channel)

applies the reversed level operation to just the channels specified. It compresses the full range of color values, so that they lie between the given black and white points. Gamma is applied before the values are mapped.

linearStretch
void linearStretch(Quantum blackPoint, Quantum whitePoint)

Discards any pixels below the black point and above the white point and levels the remaining pixels.

liquidRescale
void liquidRescale(Geometry size, size_t rows, double deltaX, double rigidity)

Rescale image with seam carving. To use this method, you must have installed and configured ImageMagick to use the Liquid Rescale Library.

magick
void magick(string str)
string magick()

Image format (e.g. "GIF")

magnify
void magnify()

A convenience method that scales an image proportionally to twice its size.

matteColor
void matteColor(Color color)
Color matteColor()

Set the image transparent color. The default is "#bdbdbd".

matteColor
void matteColor(string color)

Set the image transparent color. The default is "#bdbdbd".

meanErrorPerPixel
double meanErrorPerPixel()

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.

medianFilter
void medianFilter(size_t radius)

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.

minify
void minify()

A convenience method that scales an image proportionally to half its size.

modulate
void modulate(double brightness, double saturation, double hue)

Modulate percent hue, saturation, and brightness of an image. Modulation of saturation and brightness is as a ratio of the current value (1 ( == 100% ) for no change).

modulusDepth
size_t modulusDepth()

Image modulus depth (minimum number of bits required to support red/green/blue components without loss of accuracy). The pixel modulus depth may be decreased by supplying a value which is less than the current value, updating the pixels (reducing accuracy) to the new depth. The pixel modulus depth can not be increased over the current value using this method.

modulusDepth
void modulusDepth(size_t depth)

Image modulus depth (minimum number of bits required to support red/green/blue components without loss of accuracy). The pixel modulus depth may be decreased by supplying a value which is less than the current value, updating the pixels (reducing accuracy) to the new depth. The pixel modulus depth can not be increased over the current value using this method.

monitor
bool delegate(string, long, ulong) monitor()

Establish a progress monitor. Most Image and ImageList methods will periodically call the monitor with arguments indicating the progress of the method.

monitor
void monitor(bool delegate(string methodName, long offset, ulong extent) progressMonitor)

Establish a progress monitor. Most Image and ImageList methods will periodically call the monitor with arguments indicating the progress of the method.

montageGeometry
Geometry montageGeometry()

Tile size and offset within an image montage. Only valid for images produced by montage.

motionBlur
void motionBlur(double radius, double sigma, double angle, ChannelType channel)

Simulates motion blur. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). Use a radius of 0 and motion_blur selects a suitable radius for you. Angle gives the angle of the blurring motion.

negate
void negate(bool grayscale, ChannelType channel)

Negates the colors in the reference image.

normalize
void normalize(ChannelType channel)

Enhances the contrast of a color image by adjusting the pixel color to span the entire range of colors available.

normalizedMaxError
double normalizedMaxError()

The normalized max 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.

normalizedMeanError
double normalizedMeanError()

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.

oilPaint
void oilPaint(double radius)

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.

opDispatch
void opDispatch(string value)

Sets the value of the image property. An image may have any number of properties. ImageMagick predefines some properties, including attribute, label, caption, comment, signature, and in some cases EXIF.

opDispatch
auto opDispatch()

Returns the value of the image property.

opacity
void opacity(Quantum value)

Set or attenuate the opacity channel in the image. If the image pixels are opaque then they are set to the specified opacity value, otherwise they are blended with the supplied opacity value.

opaque
void opaque(Color target, Color fill, bool invert, ChannelType channel)

Changes all pixels having the target color to the fill color.

orderedDither
void orderedDither(string map)

Dithers the image to a predefined pattern.

orientation
void orientation(OrientationType orientation)
OrientationType orientation()

Image orientation. Supported by some file formats such as DPX and TIFF. Useful for turning the right way up.

page
void page(Geometry geometry)
Geometry page()

When compositing, this attribute describes the position of this image with respect to the underlying image.

ping
void ping(void[] blob)

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

ping
void ping(string filename)

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

pixelInterpolationMethod
void pixelInterpolationMethod(InterpolatePixelMethod method)
InterpolatePixelMethod pixelInterpolationMethod()

The pixel color interpolation method. Some methods (such as wave, swirl, implode, and composite) use the pixel color interpolation method to determine how to blend adjacent pixels.

polaroid
void polaroid(double angle)

Produce an image that looks like a Polaroid® instant picture. If the image has a "Caption" property, the value is used as a caption.

posterize
void posterize(size_t levels, bool dither)

Reduces the image to a limited number of colors for a "poster" effect.

preview
Image preview(PreviewType preview)

Creates an image that contains 9 small versions of the receiver image. The center image is the unchanged receiver. The other 8 images are variations created by transforming the receiver according to the specified preview type with varying parameters.

process
void process(string name, string[] arguments)

Execute the named process module, passing any arguments arguments. An exception is thrown if the requested process module does not exist, fails to load, or fails during execution.

profile
void profile(string name, void[] blob)
void[] profile(string name)

Get/set/remove a named profile. Valid names include "*", "8BIM", "ICM", "IPTC", or a user/format-defined profile name.

quality
void quality(size_t quality)
size_t quality()

JPEG/MIFF/PNG compression level (default 75).

quantize
void quantize(bool measureError)

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.

raise
void raise(size_t width, size_t height, bool raised)

Creates a simulated three-dimensional button-like effect by lightening and darkening the edges of the image.

randomThreshold
void randomThreshold(Geometry thresholds, ChannelType channel)

Changes the value of individual pixels based on the intensity of each pixel compared to a random threshold. The result is a low-contrast, two color image.

read
void read(size_t width, size_t height, string map, T[] pixels)

Reads an image from an array of pixels.

read
void read(void[] blob, Geometry size, string magick)
void read(void[] blob, Geometry size, size_t depth, string magick)
void read(void[] blob, Geometry size, size_t depth)
void read(void[] blob, Geometry size)

Reads an image from an in-memory blob. The Blob size, depth and magick format may also be specified.

read
void read(void[] blob)

Reads an image from an in-memory blob. The Blob size, depth and magick format may also be specified.

read
void read(string filename, Geometry size)

Read an Image by reading from the file or URL specified by filename with the specified size. Usefull for images that don't specify their size.

read
void read(string filename)

Read an Image by reading from the file or URL specified by filename.

reduceNoise
void reduceNoise(size_t radius)

Smooths the contours of an image while still preserving edge information. The algorithm works by replacing each pixel with its neighbor closest in value.

remap
void remap(Image reference)

Reduce the number of colors in img to the colors used by reference. If a dither method is set then the given colors are dithered over the image as necessary, otherwise the closest color (in RGB colorspace) is selected to replace that pixel in the image.

renderingIntent
void renderingIntent(RenderingIntent intent)
RenderingIntent renderingIntent()

The type of rendering intent.

resample
void resample(double xResolution, double yResolution, FilterTypes filter, double blur)

Resize image in terms of its pixel size, so that when displayed at the given resolution it will be the same size in terms of real world units as the original image at the original resolution.

resize
void resize(Geometry size, FilterTypes filter, double blur)

scales an image to the desired dimensions, using the given filter.

resolutionUnits
void resolutionUnits(ResolutionType type)
ResolutionType resolutionUnits()

Units of image resolution

roll
void roll(ssize_t xOffset, ssize_t yOffset)

Offsets an image as defined by xOffset and yOffset.

rotate
void rotate(double degrees)

Rotate the image by specified number of degrees. Rotated images are usually larger than the originals and have 'empty' triangular corners. Empty triangles left over from shearing the image are filled with the background color defined by the 'backgroundColor' property of the image.

rotationalBlur
void rotationalBlur(double angle, ChannelType channel)

Applies a rotational blur to the image.

rows
size_t rows()

The height of the image in pixels.

sample
void sample(Geometry size)

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.

scale
void scale(Geometry size)

Resize image by using simple ratio algorithm.

scene
void scene(size_t value)
size_t scene()

The scene number assigned to the image the last time the image was written to a multi-image image file.

segment
void segment(double clusterThreshold, double smoothingThreshold)

Segments an image by analyzing the histograms of the color components and identifying units that are homogeneous with the fuzzy c-means technique. Also uses quantizeColorSpace and verbose image properties.

selectiveBlur
void selectiveBlur(double radius, double sigma, double threshold, ChannelType channel)

Selectively blur pixels within a contrast threshold.

sepiatone
void sepiatone(double threshold)

applies a special effect to the image, similar to the effect achieved in a photo darkroom by sepia toning. A threshold of 80% is a good starting point for a reasonable tone.

shade
void shade(double azimuth, double elevation, bool shading)

shines a distant light on an image to create a three-dimensional effect. You control the positioning of the light with azimuth and elevation.

shadowImage
Image shadowImage(ssize_t xOffset, ssize_t yOffset, double sigma, double opacity)

Simulates a shadow from the specified image and returns it. This method only works when the image has opaque parts and transparent parts. Note that the resulting image is just the shadow.

sharpen
void sharpen(double radius, double sigma, ChannelType channel)

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.

shave
void shave(Geometry geometry)

Removes pixels from the edges of the image, leaving the center rectangle.

shear
void shear(double xShearAngle, double yShearAngle)

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, xShearAngle is measured relative to the Y axis, and similarly, for Y direction shears yShearAngle is measured relative to the X axis. Empty triangles left over from shearing the image are filled with the background color.

sigmoidalContrast
void sigmoidalContrast(double contrast, double midpoint, bool sharpen, ChannelType channel)

Adjusts the contrast of an image channel with a non-linear sigmoidal contrast algorithm. Increases the contrast of the image using a sigmoidal transfer function without saturating highlights or shadows.

size
Geometry size()

Width and height of a image.

sketch
void sketch(double radius, double sigma, double angle)

Simulates a pencil sketch. For best results start with a grayscale image.

solarize
void solarize(Quantum threshold, ChannelType channel)

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.

sparseColor
void sparseColor(SparseColorMethod method, Tuple!(size_t, "x", size_t, "y", Color, "color")[] args)

Fills the image with the specified color or colors, starting at the x,y coordinates associated with the color and using the specified interpolation method.

splice
void splice(Geometry geometry)

Splice the background color into the image as defined by the geometry. This method is the opposite of chop.

spread
void spread(double radius)

Randomly displaces each pixel in a block defined by the radius parameter.

statistic
void statistic(StatisticType type, size_t width, size_t height)

Makes each pixel the min / max / median / mode / etc. of the neighborhood of the specified width and height.

stegano
void stegano(Image watermark, ssize_t offset)

Hides a digital watermark in the receiver. You can retrieve the watermark by reading the file with the stegano: prefix, thereby proving the authenticity of the file.

stereo
void stereo(Image rightImage)

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.

strip
void strip()

Strips an image of all profiles and comments.

swirl
void swirl(double degrees)

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.

syncProfiles
void syncProfiles()

synchronizes image properties with the image profiles. Currently we only support updating the EXIF resolution and orientation.

threshold
void threshold(Quantum value)

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.

thumbnail
void thumbnail(Geometry size)

changes the size of an image to the given dimensions and removes any associated profiles. The goal is to produce small low cost thumbnail images suited for display on the Web.

toBlob
void[] toBlob(string magick, size_t depth)

Creates a Binary Large OBject, a direct-to-memory version of the image.

toString
string toString()

Constructs a description of the image as a string. The string contains some or all of the following fields:

    totalColors
    size_t totalColors()

    Number of colors in the image.

    transparent
    void transparent(Color color, Quantum opacity, bool invert)

    Changes the opacity value of all the pixels that match color to the value specified by opacity. By default the pixel must match exactly, but you can specify a tolerance level by setting the fuzz attribute on the image.

    transparentChroma
    void transparentChroma(Color low, Color high, Quantum opacity, bool invert)

    Changes the opacity value associated with any pixel between low and high to the value defined by opacity.

    transpose
    void transpose()

    Creates a horizontal mirror image by reflecting the pixels around the central y-axis while rotating them by 90 degrees.

    transverse
    void transverse()

    Creates a vertical mirror image by reflecting the pixels around the central x-axis while rotating them by 270 degrees

    trim
    void trim()

    Removes the edges that are exactly the same color as the corner pixels. Use the fuzz property to make trim remove edges that are nearly the same color as the corner pixels.

    type
    void type(ImageType imageType)
    ImageType type()

    Image type.

    uniqueColors
    Image uniqueColors()

    Constructs a new image with one pixel for each unique color in the image. The new image has 1 row. The row has 1 column for each unique pixel in the image.

    unsharpMask
    void unsharpMask(double radius, double sigma, double amount, double threshold, ChannelType channel)

    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.

    view
    dmagick.ImageView.ImageView view(Geometry area)

    Get a view into the image. The ImageView can be used to modify individual pixels of the image.

    vignette
    void vignette(ssize_t xOffset, ssize_t yOffset, double radius, double sigma)

    Gradually shades the edges of the image by transforming the pixels into the background color.

    virtualPixelMethod
    void virtualPixelMethod(VirtualPixelMethod method)
    VirtualPixelMethod virtualPixelMethod()

    Specify how "virtual pixels" behave. Virtual pixels are pixels that are outside the boundaries of the image. Methods such as blurImage, sharpen, and wave use virtual pixels.

    wave
    void wave(double amplitude, double wavelength)

    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.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.

    whiteThreshold
    void whiteThreshold(Quantum red, Quantum green, Quantum blue, Quantum opacity, ChannelType channel)

    Forces all pixels above the threshold into white while leaving all pixels below the threshold unchanged.

    whiteThreshold
    void whiteThreshold(Quantum threshold, ChannelType channel)

    Forces all pixels above the threshold into white while leaving all pixels below the threshold unchanged.

    write
    void write(string filename)

    Writes the image to the specified file. ImageMagick determines image format from the prefix or extension.

    xResolution
    double xResolution()

    Horizontal resolution of the image.

    yResolution
    double yResolution()

    Vertical resolution of the image.

    Static functions

    ImageProgressMonitor
    MagickBooleanType ImageProgressMonitor(const(char)* methodName, MagickOffsetType offset, MagickSizeType extend, Image image)
    Undocumented in source. Be warned that the author may not have intended to support it.
    cacheThreshold
    void cacheThreshold(size_t threshold)

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

    Variables

    imageRef
    ImageRef imageRef;
    Undocumented in source.
    options
    Options options;

    The options for this image.

    Meta