public class MagickImage extends Magick
Constructor and Description |
---|
MagickImage()
Constructor.
|
MagickImage(ImageInfo imageInfo)
Constructor that also reads an image file
specified in the parameter.
|
MagickImage(ImageInfo imageInfo,
boolean ping)
Constructor that also reads an image file
specified in the parameter.
|
MagickImage(ImageInfo imageInfo,
byte[] blob)
Constructor that takes the image to be read from memory.
|
MagickImage(MagickImage[] images)
Construct a MagickImage that is made up of all
the images in the specified array.
|
Modifier and Type | Method and Description |
---|---|
MagickImage |
addNoiseImage(int noiseType)
Adds random noise to the image.
|
void |
allocateImage(ImageInfo imageInfo)
Allocate a blank image object.
|
void |
annotateImage(DrawInfo info) |
MagickImage |
autoOrientImage()
This operator reads and resets the EXIF image profile setting 'Orientation'
and then performs the appropriate 90 degree rotation on the image
to orient the image, for correct viewing.
|
MagickImage |
averageImages()
The Average() method takes a set of images and
averages them together.
|
void |
blobToImage(ImageInfo imageInfo,
byte[] blob)
Takes from memory an image in a known format and read it into
itself.
|
MagickImage |
blurImage(double raduis,
double sigma)
Blurs an image.
|
MagickImage |
blurImageChannel(int channel,
double raduis,
double sigma)
Blurs an image.
|
MagickImage |
borderImage(java.awt.Rectangle borderInfo)
Surrounds the image with a border of the color defined by
the border color member of the image structure.
|
MagickImage[] |
breakFrames()
Destructively create array of image frames.
|
MagickImage |
charcoalImage(double raduis,
double sigma)
Creates a new image that is a copy of an existing one with the
edges highlighted, producing a 'charcoal-drawing' effect.
|
MagickImage |
chopImage(java.awt.Rectangle chopInfo)
Creates a new image that is a subregion of the original.
|
MagickImage |
cloneImage(int columns,
int rows,
boolean clonePixels)
Returns a copy of all fields of the input image.
|
boolean |
colorFloodfillImage(DrawInfo drawInfo,
PixelPacket target,
int x,
int y,
int method)
Changes the color value of any pixel that matches target
and is an immediate neighbor.
|
MagickImage |
colorizeImage(java.lang.String opacity,
PixelPacket target)
Colourises the image with a pen colour.
|
boolean |
compositeImage(int compOp,
MagickImage compImage,
int xOff,
int yOff)
Composite the image supplied onto itself at the specified offsets.
|
void |
constituteImage(int width,
int height,
java.lang.String map,
byte[] pixels)
Create a new image of 8-bit component of the specified dimensions.
|
void |
constituteImage(int width,
int height,
java.lang.String map,
float[] pixels)
Create a new image of float component of the specified dimensions.
|
void |
constituteImage(int width,
int height,
java.lang.String map,
int[] pixels)
Create a new image of 32-bit component of the specified dimensions.
|
boolean |
contrastImage(boolean sharpen)
Enhances the intensity differences between the lighter and
darker elements of the image.
|
MagickImage |
convolveImage(int order,
double[] kernel)
Applies a general image convolution kernel to an image returns
the results.
|
MagickImage |
cropImage(java.awt.Rectangle chopInfo)
Creates a new image that is a subregion of the original.
|
void |
cycleColormapImage(int amount)
Cycles the image colormap by a specified amount.
|
MagickImage |
despeckleImage()
Creates a new image that is a copy of an existing one with the
speckle noise minified.
|
void |
destroyImages()
Called by finalize to deallocate the image handle.
|
boolean |
dispatchImage(int x,
int y,
int width,
int height,
java.lang.String map,
byte[] pixels)
Get the pixels as 8-bit components from the image.
|
boolean |
dispatchImage(int x,
int y,
int width,
int height,
java.lang.String map,
float[] pixels)
Get the pixels as float components from the image.
|
boolean |
dispatchImage(int x,
int y,
int width,
int height,
java.lang.String map,
int[] pixels)
Get the pixels as 32-bit components from the image.
|
boolean |
drawImage(DrawInfo aInfo)
Draws a primitive (line, rectangle, ellipse) on the image.
|
MagickImage |
edgeImage(double raduis)
Finds edges in an image.
|
MagickImage |
embossImage(double raduis,
double sigma)
Returns a grayscale image with a three-dimensional effect.
|
MagickImage |
enhanceImage()
Applies a digital filter that improves the quality of a noisy image.
|
boolean |
equalizeImage()
Performs histogram equalization.
|
protected void |
finalize()
This method will clean up the handle.
|
MagickImage |
flipImage()
Creates a new image that reflects each scanline
in the vertical direction.
|
MagickImage |
flopImage()
Creates a new image that reflects each scanline in the
horizontal direction
|
boolean |
gammaImage(java.lang.String gamma)
Converts the reference image to gamma corrected colors.
|
MagickImage |
gaussianBlurImage(double raduis,
double sigma)
Blurs the image using a gaussian operator.
|
PixelPacket |
getBackgroundColor()
Get the current background colour.
|
PixelPacket |
getBorderColor()
Get the current border colour used by method borderImage.
|
PixelPacket[] |
getColormap()
Get the entire colour map.
|
PixelPacket |
getColormap(int index)
Get the colour specified by the index.
|
ProfileInfo |
getColorProfile()
Obtain the color profile from the image.
|
int |
getColors()
The number of colors in the colourmap.
|
int |
getColorspace()
Get the colorspace of the image.
|
int |
getCompression()
Get the CompressionType of the image.
|
int |
getDelay()
Get the time in 1/100ths of a second (0 to 65535) which must
expire before displaying the next image in an animated sequence.
|
int |
getDepth()
Return the depth of the image.
|
java.awt.Dimension |
getDimension()
Return the number of columns and rows of the image.
|
int |
getDispose()
Get the GIF disposal method.
|
java.lang.String |
getFileName()
Return the image file name of the image.
|
int |
getFilter()
Get the filter type.
|
ProfileInfo |
getGenericProfile(int i)
Return the generic profile specified by the index.
|
int |
getGenericProfileCount()
Return the number of generic profiles.
|
java.lang.String |
getImageAttribute(java.lang.String key)
Searches the list of image attributes and returns
the value of the attribute if it exists otherwise null.
|
java.lang.String |
getImageFormat() |
byte[] |
getImageProfile(java.lang.String profileName)
GetImageProfile() gets a profile associated with an image by name.
|
int |
getImageType()
Get the image type from the MagickImage
|
ProfileInfo |
getIptcProfile()
Obtain the IPTC profile from the image.
|
int |
getIterations()
Get the number of iterations to loop an animation (e.g.
|
java.lang.String |
getMagick()
Return the image format (i.e., Gif, Jpeg,...)
|
boolean |
getMatte()
Get the matte attribute of the image.
|
int |
getNumberColors()
Return the number of unique colors in an image.
|
int |
getNumFrames() |
PixelPacket |
getOnePixel(int x,
int y)
Get the colour at the specified row and column
|
int |
getQuality() |
int |
getRenderingIntent()
Get the intent attribute of the image.
|
int |
getStorageClass()
Return the storage class of the image.
|
int |
getTotalColors()
Get the The number of colors in the image after QuantizeImage(),
or QuantizeImages().
|
int |
getUnits()
Get the units attribute of the image.
|
double |
getXResolution()
Get the x_resolution attribute in the image.
|
double |
getYResolution()
Get the y_resolution attribute in the image.
|
boolean |
hasFrames()
Check if the image has multiple frames.
|
byte[] |
imageToBlob(ImageInfo imageInfo)
Returns an array that contents the image format.
|
MagickImage |
implodeImage(double amount)
Implodes the image's pixels about the center.
|
boolean |
isAnimatedImage()
Returns True if the Gif image is Animated otherwise False is returned.
|
boolean |
isGrayImage()
Returns True if the image is grayscale otherwise False is returned.
|
boolean |
isMonochromeImage()
Returns True if the image is monochrome otherwise False is returned.
|
boolean |
levelImage(java.lang.String levels)
Adjusts the levels of an image given these points: black,
mid, and white.
|
MagickImage |
magnifyImage()
Creates a new image that is a integral size greater
than an existing one.
|
boolean |
matteFloodfillImage(PixelPacket target,
int matte,
int x,
int y,
int method)
Floodfills the designated area with a matte value.
|
MagickImage |
medianFilterImage(double radius)
Applies a digital filter that improves the quality of a noisy image.
|
MagickImage |
minifyImage()
Creates a new image that is a integral size less than an existing one.
|
boolean |
modulateImage(java.lang.String modulate)
Modulates the hue, saturation, and brightness of an image.
|
MagickImage |
montageImages(MontageInfo montageInfo)
Create a montage of all the images in the list.
|
boolean |
negateImage(int grayscale)
Negates the colors in the reference image.
|
protected MagickImage |
nextImage()
Return image object for next image in sequence of frames.
|
boolean |
normalizeImage()
Normalizes the pixel values to span the full range of color values.
|
MagickImage |
oilPaintImage(double radius)
Applies a special effect filter that simulates an oil painting.
|
boolean |
opaqueImage(PixelPacket target,
PixelPacket penColor)
Changes the color of an opaque pixel to the pen color.
|
void |
pingImage(ImageInfo imageInfo)
Pings the image.
|
boolean |
profileImage(java.lang.String profileName,
byte[] profileData)
ProfileImage adds or removes a ICM, IPTC, or generic profile
from an image.
|
boolean |
quantizeImage(QuantizeInfo quantizeInfo)
Analyzes the colors within a reference image and chooses a
fixed number of colors to represent the image.
|
boolean |
raiseImage(java.awt.Rectangle raiseInfo,
boolean raise)
Creates a simulated three-dimensional button-like effect by
lightening and darkening the edges of the image.
|
void |
readImage(ImageInfo imageInfo)
Read the image specified in the ImageInfo object.
|
MagickImage |
reduceNoiseImage(double radius)
This operation attempts to reduce the 'noise' in the image.
|
boolean |
resetImagePage(java.lang.String page)
resets the image page canvas and position..
|
MagickImage |
resizeImage(int cols,
int rows,
double blur)
Return a new image that is a resized version of the original.
|
boolean |
rgbTransformImage(int colorspace)
Converts the reference image from RGB to an alternate colorspace.
|
MagickImage |
rollImage(int xOffset,
int yOffset)
Rolls an image vertically and horizontally.
|
MagickImage |
rotateImage(double degrees)
Creates a new image that is a rotated copy of an existing one.
|
MagickImage |
sampleImage(int cols,
int rows)
Creates a new image that is a scaled size of an existing one
using pixel sampling.
|
MagickImage |
scaleImage(int cols,
int rows)
Return a new image that is a scaled version of the
original.
|
int |
segmentImage(int colorspace,
double cluster_threshold,
double smoothing_threshold)
Segment an image by analyzing the histograms of the color components
and identifying units that are homogeneous using the fuzzy c-means
technique.
|
void |
setBackgroundColor(PixelPacket color)
Set the background colour.
|
void |
setBorderColor(PixelPacket color)
Set the border colour for the method borderImage.
|
void |
setColorProfile(ProfileInfo profile)
Set a new color profile for the image.
|
void |
setCompression(int value)
Set the compression attribute.
|
void |
setDelay(int delay)
Set the time in 1/100ths of a second (0 to 65535) which must
expire before displaying the next image in an animated sequence.
|
void |
setDepth(int depth)
Set the depth of the image.
|
void |
setDispose(int dispose)
Set the GIF disposal method.
|
void |
setFileName(java.lang.String fileName)
Set the image file name.
|
void |
setFilter(int filter)
Set the filter type.
|
void |
setGrayscale()
Deprecated.
Use QuantizeInfo with MagickImage.quantizeImage
to acheive the same effect.
|
boolean |
setImageAttribute(java.lang.String key,
java.lang.String value)
Searches the list of image attributes and replaces the
attribute value.
|
void |
setImageFormat(java.lang.String imageFormat) |
boolean |
setImageProfile(java.lang.String profileName,
byte[] profileData)
SetImageProfile() adds a named profile to the image.
|
void |
setIptcProfile(ProfileInfo profile)
Set a new IPTC profile for the image.
|
void |
setIterations(int iterations)
Set the number of iterations to loop an animation (e.g.
|
void |
setMagick(java.lang.String imageFormat) |
void |
setMatte(boolean matte)
Set the matte attribute of the image.
|
void |
setNumberColors(int numberColors) |
void |
setQuality(int value) |
void |
setRenderingIntent(int renderingIntent)
Set the intent attribute of the image.
|
void |
setUnits(int resolutionType)
Set the units attribute of the image.
|
void |
setXResolution(double xRes)
Set the x_resolution attribute in the image.
|
void |
setYResolution(double yRes)
Get the y_resolution attribute in the image.
|
MagickImage |
sharpenImage(double raduis,
double sigma)
Creates a new image that is a copy of an existing one with the
pixels sharpened.
|
MagickImage |
shearImage(double x_shear,
double y_shear)
Creates a new image that is a shear_image copy of an existing one.
|
boolean |
signatureImage()
Determine signature of image and place signature
in the image's attributes.
|
int |
sizeBlob()
Returns the current length of the image file or blob.
|
void |
solarizeImage(double threshold)
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.
|
boolean |
sortColormapByIntensity()
Sorts the colormap of a PseudoClass image by decreasing
color intensity.
|
MagickImage |
spreadImage(int radius)
A special effects method that randomly displaces each pixel in a
block defined by the radius parameter.
|
MagickImage |
swirlImage(double degress)
Swirls the pixels about the center of the image, where degrees
indicates the sweep of the arc through which each pixel is moved.
|
void |
syncImage()
Initializes the red, green, and blue intensities of each
pixel as defined by the colormap index.
|
void |
textureImage(MagickImage image)
Layers a texture onto the background of an image.
|
boolean |
thresholdImage(double threshold)
Thresholds the reference image.
|
void |
transformImage(java.lang.String cropGeometry,
java.lang.String imageGeometry)
Creates a new image that is a transformed size of of
existing one as specified by the crop and image geometries.
|
boolean |
transformRgbImage(int colorspace)
Converts the reference image from an alternate colorspace.
|
boolean |
transparentImage(PixelPacket color,
int opacity)
Creates a matte image associated with the image.
|
MagickImage |
trimImage()
Trim edges that are the background color from the image.
|
MagickImage |
unsharpMaskImage(double raduis,
double sigma,
double amount,
double threshold)
Creates a new image that is a copy of an existing one with
the pixels sharpened using an "unsharp" masking technique.
|
MagickImage |
waveImage(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.
|
boolean |
writeImage(ImageInfo imageInfo)
Write the image specified in the ImageInfo object.
|
MagickImage |
zoomImage(int cols,
int rows)
Creates a new image that is a scaled size of an existing one.
|
parseImageGeometry
public MagickImage()
public MagickImage(MagickImage[] images) throws MagickException
images
- array of images to linkedMagickException
public MagickImage(ImageInfo imageInfo, boolean ping) throws MagickException
imageInfo
- the ImageInfo for an image file to readboolean
- true for ping the image only.MagickException
- on errorpublic MagickImage(ImageInfo imageInfo) throws MagickException
imageInfo
- the ImageInfo for an image file to readMagickException
- on error on errorpublic MagickImage(ImageInfo imageInfo, byte[] blob) throws MagickException
imageInfo
- the ImageInfo instance for default settings, etcblob
- the image to be read in memoryMagickException
- on errorpublic void pingImage(ImageInfo imageInfo) throws MagickException
imageInfo
- the ImageInfo for an image file to readMagickException
protected void finalize()
finalize
in class java.lang.Object
public void allocateImage(ImageInfo imageInfo)
imageInfo
- specifies the parameters for the blank imagepublic void readImage(ImageInfo imageInfo) throws MagickException
imageInfo
- specifies the file to read fromMagickException
- on errorpublic boolean writeImage(ImageInfo imageInfo) throws MagickException
imageInfo
- specifies the writing parametersMagickException
- on errorpublic java.lang.String getFileName() throws MagickException
MagickException
- on errorpublic void setFileName(java.lang.String fileName) throws MagickException
fileName
- new file nameMagickException
- on errorpublic void setFilter(int filter) throws MagickException
filter
- the filter type from constants defined in the class FilterTypeMagickException
- on errorFilterType
public int getFilter() throws MagickException
MagickException
- on errorFilterType
public MagickImage addNoiseImage(int noiseType) throws MagickException
noiseType
- The type of noise: Uniform, Gaussian, Multiplicative,
Impulse, Laplacian, or Poisson.MagickException
- on errorNoiseType
,
The underlying ImageMagick callpublic java.awt.Dimension getDimension() throws MagickException
MagickException
- on errorpublic int getDepth() throws MagickException
MagickException
- on errorpublic void setDepth(int depth) throws MagickException
depth
- the depth of the imageMagickException
- on errorpublic MagickImage blurImage(double raduis, double sigma) throws MagickException
raduis
- The radius of the gaussian, in pixels, not counting
the center pixelsigma
- The standard deviation of the gaussian, in pixelsMagickException
- on errorpublic MagickImage blurImageChannel(int channel, double raduis, double sigma) throws MagickException
channel
- The channel(s) to which the blurring should apply
(see ChannelType)raduis
- The radius of the gaussian, in pixels, not counting
the center pixelsigma
- The standard deviation of the gaussian, in pixelsMagickException
- on errorpublic MagickImage trimImage() throws MagickException
MagickException
- on errorpublic boolean resetImagePage(java.lang.String page) throws MagickException
page
- String representing the new page geometryMagickException
public int getStorageClass() throws MagickException
MagickException
- on errorClassType
public void annotateImage(DrawInfo info)
public MagickImage borderImage(java.awt.Rectangle borderInfo) throws MagickException
borderInfo
- the rectangle for which border is drawnMagickException
- on errorsetBorderColor(magick.PixelPacket)
,
getBorderColor()
public MagickImage charcoalImage(double raduis, double sigma) throws MagickException
raduis
- The radius of the pixel neighborhood.sigma
- The standard deviation of the gaussian, in pixelsMagickException
- on errorpublic boolean raiseImage(java.awt.Rectangle raiseInfo, boolean raise) throws MagickException
raiseInfo
- the rectangle for which border is drawnraise
- true to create raise effect, false to lowerMagickException
- on errorpublic MagickImage chopImage(java.awt.Rectangle chopInfo) throws MagickException
chopInfo
- the rectange to chop the imageMagickException
- on errorpublic MagickImage colorizeImage(java.lang.String opacity, PixelPacket target) throws MagickException
opacity
- string percentage value for opacitytarget
- a colour valueMagickException
- on errorpublic boolean compositeImage(int compOp, MagickImage compImage, int xOff, int yOff) throws MagickException
MagickException
- on errorpublic boolean contrastImage(boolean sharpen) throws MagickException
MagickException
- on errorpublic MagickImage cloneImage(int columns, int rows, boolean clonePixels) throws MagickException
MagickException
- on errorpublic void constituteImage(int width, int height, java.lang.String map, byte[] pixels) throws MagickException
width
- the width of the new imageheight
- the height of the new imagemap
- the components of a pixelpixels
- the raw image in an array of pixelsMagickException
- on errorpublic void constituteImage(int width, int height, java.lang.String map, int[] pixels) throws MagickException
width
- the width of the new imageheight
- the height of the new imagemap
- the components of a pixelpixels
- the raw image in an array of pixelsMagickException
- on errorpublic void constituteImage(int width, int height, java.lang.String map, float[] pixels) throws MagickException
width
- the width of the new imageheight
- the height of the new imagemap
- the components of a pixelpixels
- the raw image in an array of pixelsMagickException
- on errorpublic MagickImage cropImage(java.awt.Rectangle chopInfo) throws MagickException
chopInfo
- the subimageMagickException
- on errorpublic void cycleColormapImage(int amount) throws MagickException
MagickException
- on errorpublic void destroyImages()
public boolean drawImage(DrawInfo aInfo) throws MagickException
MagickException
- on errorpublic MagickImage edgeImage(double raduis) throws MagickException
raduis
- The radius of the pixel neighborhood.MagickException
- on errorpublic MagickImage embossImage(double raduis, double sigma) throws MagickException
raduis
- The radius of the pixel neighborhood.sigma
- The standard deviation of the Gaussian, in pixelsMagickException
- on errorpublic MagickImage enhanceImage() throws MagickException
MagickException
- on errorpublic boolean equalizeImage() throws MagickException
MagickException
- on errorpublic MagickImage flipImage() throws MagickException
MagickException
- on errorpublic MagickImage flopImage() throws MagickException
MagickException
- on errorpublic boolean gammaImage(java.lang.String gamma) throws MagickException
MagickException
- on errorpublic MagickImage gaussianBlurImage(double raduis, double sigma) throws MagickException
raduis
- The radius of the Gaussian, in pixels, not counting
the center pixelsigma
- The standard deviation of the Gaussian, in pixels.MagickException
- on errorpublic MagickImage implodeImage(double amount) throws MagickException
amount
- Amount of implosion if positive, explosion if negative.MagickException
- on errorpublic boolean isGrayImage() throws MagickException
MagickException
- on errorpublic boolean isMonochromeImage() throws MagickException
MagickException
- on errorpublic MagickImage magnifyImage() throws MagickException
MagickException
- on errorpublic boolean matteFloodfillImage(PixelPacket target, int matte, int x, int y, int method) throws MagickException
MagickException
- on errorpublic boolean colorFloodfillImage(DrawInfo drawInfo, PixelPacket target, int x, int y, int method) throws MagickException
drawInfo
- The draw infotarget
- The RGB value of the target colourx
- the starting x location of the operationy
- the starting y location of the operationmethod
- either FloodfillMethod or FilltoBorderMethodMagickException
- if any error occursPaintMethod
public MagickImage medianFilterImage(double radius) throws MagickException
radius
- The radius of the pixel neighborhood.MagickException
- on errorpublic MagickImage minifyImage() throws MagickException
MagickException
- on errorpublic boolean modulateImage(java.lang.String modulate) throws MagickException
MagickException
- on errorpublic boolean negateImage(int grayscale) throws MagickException
MagickException
- on errorpublic boolean normalizeImage() throws MagickException
MagickException
- on errorpublic MagickImage oilPaintImage(double radius) throws MagickException
radius
- The radius of the pixel neighborhood.MagickException
- on errorpublic boolean opaqueImage(PixelPacket target, PixelPacket penColor) throws MagickException
target
- the color to search for in the imagepenColor
- the color to replace it withMagickException
- on errorpublic MagickImage reduceNoiseImage(double radius) throws MagickException
The principal function of the 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 in a circular neighborhood if this pixel has been found to be noise. A pixel is defined as noise if the pixel is a minimum or maximum within the neighborhood.
radius
- The radius of the pixel neighborhood.MagickException
- on errorpublic boolean rgbTransformImage(int colorspace) throws MagickException
colorspace
- the target colorspace to transform toMagickException
- on errorpublic MagickImage rollImage(int xOffset, int yOffset) throws MagickException
xOffset
- An integer that specifies the number of columns \
to roll in the horizontal directionyOffset
- An integer that specifies the number of rows to \
roll in the vertical directionMagickException
- on errorpublic MagickImage sampleImage(int cols, int rows) throws MagickException
cols
- An integer that specifies the number of columns in \
the sampled imagerows
- An integer that specifies the number of rows in the \
sampled imageMagickException
- on errorpublic MagickImage scaleImage(int cols, int rows) throws MagickException
cols
- An integer that specifies the number of columns in \
the scaled imagerows
- An integer that specifies the number of rows in the \
scaled imageMagickException
- on errorpublic MagickImage resizeImage(int cols, int rows, double blur) throws MagickException
cols
- An integer that specifies the number of columns in
the resized imagerows
- An integer that specifies the number of rows in the
resized imageblur
- - The blur factor where > 1 is blurry, < 1 is sharp.
Typically set this to 1.0.MagickException
- on errorpublic int segmentImage(int colorspace, double cluster_threshold, double smoothing_threshold) throws MagickException
colorspace
- A ColorspaceType
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.cluster_threshold
- Specify cluster threshold as the number of
pixels in each cluster must exceed the the
cluster threshold to be considered valid.smoothing_threshold
- 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.MagickException
- on errorColorspaceType
public void solarizeImage(double threshold) throws MagickException
threshold
- Ranges from 0 to MaxRGB and is a measure of the
extent of the solarization.MagickException
- on errorpublic boolean sortColormapByIntensity() throws MagickException
MagickException
- on errorpublic MagickImage spreadImage(int radius) throws MagickException
radius
- Choose a random pixel in a neighborhood of this extent.MagickException
- on errorpublic MagickImage swirlImage(double degress) throws MagickException
degrees
- Defines the tightness of the swirling effect.MagickException
- on errorpublic void syncImage() throws MagickException
MagickException
- on errorpublic void textureImage(MagickImage image) throws MagickException
image
- the image to use for textureMagickException
- on errorpublic boolean thresholdImage(double threshold) throws MagickException
threshold
- the threshold valueMagickException
- on errorpublic void transformImage(java.lang.String cropGeometry, java.lang.String imageGeometry) throws MagickException
cropGeometry
- a crop geometry string. This geometry \
defines a subregion of the image.imageGeometry
- a image geometry string. The specified \
width and height of this geometry string
are absolute.MagickException
- on errorpublic boolean transformRgbImage(int colorspace) throws MagickException
colorspace
- An unsigned integer value defines which \
colorspace to transform the image toMagickException
- on errorpublic boolean transparentImage(PixelPacket color, int opacity) throws MagickException
color
- The color to search for in the imageopacity
- The opacity of the transparent imageMagickException
- on errorpublic MagickImage unsharpMaskImage(double raduis, double sigma, double amount, double threshold) throws MagickException
This process starts by building a temporary, blurred
, copy of the image. Then each
pixel in this "unsharp" image is compared
against its corresponding pixel in the original image. If
their difference is above a threshold, a percentage of the
difference is added back into the original pixel.
The first two arguments, radius and sigma,
specify the blurring used to create the "unsharp" image. See
gaussianBlurImage(double, double)
for a detail explanation. It will
suffice to say that the larger the radius and sigma the more
this blurred image will diverge from the original.
The last two arguments, threshold and amount, specify the difference threshold required to apply an adjustment to each pixel and, once the threshold is reached, the amount of the difference to be added back into the original pixels. A high threshold will cause the algorithm to only adjust edge pixels. Specifying a threshold will adjust every pixel.
raduis
- The radius of the gaussian, in pixels, not counting
the center pixelsigma
- The standard deviation of the gaussian, in pixelsamount
- The percentage of the difference between the original
and the blur image that is added back into the original.threshold
- The threshold in pixels needed to apply the diffence
amount.MagickException
- on errorpublic MagickImage waveImage(double amplitude, double wavelength) throws MagickException
amplitude
- Define the amplitude of the sine wave.wavelength
- Define the wave-length of the sine wave.MagickException
- on errorpublic MagickImage zoomImage(int cols, int rows) throws MagickException
MagickException
- on errorpublic boolean dispatchImage(int x, int y, int width, int height, java.lang.String map, byte[] pixels) throws MagickException
x
- x coordinate of the origin of the subimagey
- y coordinate of the origin of the subimagewidth
- width of the subimageheight
- height of the subimagemap
- component order of the pixelspixels
- pixels of the subimageMagickException
- on errorpublic boolean dispatchImage(int x, int y, int width, int height, java.lang.String map, int[] pixels) throws MagickException
x
- x coordinate of the origin of the subimagey
- y coordinate of the origin of the subimagewidth
- width of the subimageheight
- height of the subimagemap
- component order of the pixelspixels
- pixels of the subimageMagickException
- on errorpublic boolean dispatchImage(int x, int y, int width, int height, java.lang.String map, float[] pixels) throws MagickException
x
- x coordinate of the origin of the subimagey
- y coordinate of the origin of the subimagewidth
- width of the subimageheight
- height of the subimagemap
- component order of the pixelspixels
- pixels of the subimageMagickException
- on errorpublic java.lang.String getMagick() throws MagickException
MagickException
- on errorpublic java.lang.String getImageFormat() throws MagickException
MagickException
public void setMagick(java.lang.String imageFormat) throws MagickException
MagickException
public void setImageFormat(java.lang.String imageFormat) throws MagickException
MagickException
public int getNumberColors() throws MagickException
MagickException
- on errorpublic void setNumberColors(int numberColors) throws MagickException
MagickException
public boolean isAnimatedImage() throws MagickException
MagickException
- on errorpublic MagickImage rotateImage(double degrees) throws MagickException
degrees
- angle of rotation.MagickException
- on errorpublic MagickImage shearImage(double x_shear, double y_shear) throws MagickException
x_shear
- x direction shear amounty_shear
- y direction shear amountMagickException
- on errorpublic boolean quantizeImage(QuantizeInfo quantizeInfo) throws MagickException
quantizeInfo
- contains parameters for quantizationMagickException
- on errorpublic void setGrayscale() throws MagickException
MagickException
- on errorpublic int getColorspace() throws MagickException
MagickException
- on errorColorspaceType
public MagickImage sharpenImage(double raduis, double sigma) throws MagickException
raduis
- The radius of the gaussian, in pixels, not counting \
the center pixelsigma
- The standard deviation of the gaussian, in pixelsMagickException
- on errorpublic MagickImage despeckleImage() throws MagickException
MagickException
- on errorpublic MagickImage convolveImage(int order, double[] kernel) throws MagickException
order
- The number of columns and rows in the filter kernel.kernel
- An array of double representing the convolution kernelMagickException
- on errorpublic java.lang.String getImageAttribute(java.lang.String key) throws MagickException
key
- the key of the attributeMagickException
- on errorpublic boolean setImageAttribute(java.lang.String key, java.lang.String value) throws MagickException
key
- the key of the attributevalue
- the value of the attributeMagickException
- on errorpublic void blobToImage(ImageInfo imageInfo, byte[] blob) throws MagickException
imageInfo
- a ImageInfo instanceblob
- memory containing an image in a known formatMagickException
- on errorpublic byte[] imageToBlob(ImageInfo imageInfo)
imageInfo
- the magick member of this object determines
output formatMagickException
- on errorpublic void setUnits(int resolutionType) throws MagickException
resolutionType
- the resolution type as defined in ResolutionTypeMagickException
- on errorResolutionType
public int getUnits() throws MagickException
MagickException
- on errorResolutionType
public void setXResolution(double xRes) throws MagickException
xRes
- x_resolution valueMagickException
- on errorpublic double getXResolution() throws MagickException
MagickException
- on errorpublic void setYResolution(double yRes) throws MagickException
yRes
- y_resolution valueMagickException
- on errorpublic double getYResolution() throws MagickException
MagickException
- on errorprotected MagickImage nextImage() throws MagickException
MagickException
- on errorpublic boolean hasFrames() throws MagickException
MagickException
- on errorpublic int getNumFrames() throws MagickException
MagickException
public MagickImage[] breakFrames() throws MagickException
MagickException
- on errorpublic void setColorProfile(ProfileInfo profile) throws MagickException
profile
- a new color profile. This parameter cannot be null.
Note: The profile.name attribute is ignoredMagickException
- if an error occursprofileImage(java.lang.String, byte[])
public ProfileInfo getColorProfile() throws MagickException
MagickException
- if an error occursprofileImage(java.lang.String, byte[])
public void setIptcProfile(ProfileInfo profile) throws MagickException
profile
- a new IPTC profile. This parameter cannot be null.
Note: The profile.name attribute is ignoredMagickException
- if an error occursprofileImage(java.lang.String, byte[])
public ProfileInfo getIptcProfile() throws MagickException
MagickException
- if an error occursprofileImage(java.lang.String, byte[])
public int getGenericProfileCount() throws MagickException
MagickException
- if the profile count cannot be retrievedpublic ProfileInfo getGenericProfile(int i) throws MagickException
i
- the index of the generic profile to retrieveMagickException
- if an error occurspublic boolean profileImage(java.lang.String profileName, byte[] profileData) throws MagickException
profileName
- name of profile to add or removeprofileData
- contents of the profileMagickException
- if an error occurspublic boolean setImageProfile(java.lang.String profileName, byte[] profileData) throws MagickException
profileName
- the profile name, for example icc, exif, and 8bim (8bim is the Photoshop wrapper for iptc profiles).profileData
- contents of the profileMagickException
- if an error occurshttp://www.imagemagick.org/api/profile.php#SetImageProfile
public byte[] getImageProfile(java.lang.String profileName) throws MagickException
profileName
- name of profile getMagickException
- if an error occurshttp://www.imagemagick.org/api/profile.php#GetImageProfile
public MagickImage montageImages(MontageInfo montageInfo) throws MagickException
montageInfo
- parameter used in the creation of the montageMagickException
- if an error occurspublic MagickImage autoOrientImage() throws MagickException
MagickException
- upon errorspublic MagickImage averageImages() throws MagickException
MagickException
- upon errorspublic boolean levelImage(java.lang.String levels) throws MagickException
levels
- String representing the black, mid and white levelsMagickException
public int sizeBlob() throws MagickException
MagickException
public void setCompression(int value) throws MagickException
value
- a value from CompressionTypeMagickException
- on errorwriteImage(magick.ImageInfo)
,
CompressionType
,
Command line explanationpublic int getCompression() throws MagickException
MagickException
- on errorCompressionType
public int getImageType() throws MagickException
Image
- MagickException
ImageType
public void setBorderColor(PixelPacket color) throws MagickException
color
- the border colourMagickException
- on errorborderImage(java.awt.Rectangle)
public PixelPacket getBorderColor() throws MagickException
MagickException
- on errorborderImage(java.awt.Rectangle)
public void setBackgroundColor(PixelPacket color) throws MagickException
color
- the background colourMagickException
- on errorpublic PixelPacket getBackgroundColor() throws MagickException
MagickException
- on errorpublic void setDelay(int delay) throws MagickException
delay
- the time delay in 1/100th of a secondMagickException
- upon errorpublic int getDelay() throws MagickException
MagickException
- upon errorpublic void setDispose(int dispose) throws MagickException
dispose
- the disposal method for GIF animationMagickException
- upon errorpublic int getDispose() throws MagickException
MagickException
- upon errorpublic void setIterations(int iterations) throws MagickException
iterations
- the number of iterationsMagickException
- upon errorpublic int getIterations() throws MagickException
MagickException
- upon errorpublic int getColors() throws MagickException
MagickException
- upon errorquantizeImage(magick.QuantizeInfo)
public int getTotalColors() throws MagickException
MagickException
- upon errorpublic PixelPacket getColormap(int index) throws MagickException
index
- the index for which to return a colourMagickException
- upon errorpublic PixelPacket[] getColormap() throws MagickException
MagickException
- upon errorpublic PixelPacket getOnePixel(int x, int y) throws MagickException
x
- the x position of the pixel to fetchy
- the y position of the pixel to fetchMagickException
- upon errorpublic boolean signatureImage() throws MagickException
MagickException
- on errorpublic int getQuality() throws MagickException
MagickException
- on errorpublic void setQuality(int value) throws MagickException
MagickException
public void setRenderingIntent(int renderingIntent) throws MagickException
intent
- the rendering Intent type as defined in RenderingIntentMagickException
- on errorRenderingIntent
public int getRenderingIntent() throws MagickException
MagickException
- on errorpublic void setMatte(boolean matte) throws MagickException
matte
- the matte valueMagickException
- on errorpublic boolean getMatte() throws MagickException
MagickException
- on error