effects - ImageMagick Image Effects Routines
noisy_image=AddNoiseImage(image,noise_type)
blurred_image=BlurImage(image,factor)
despeckled_image=DespeckleImage(image)
edged_image=EdgeImage(image,factor)
embossed_image=EmbossImage(image)
enhanced_image=EnhanceImage(image)
imploded_image=ImplodeImage(image,factor)
painted_image=OilPaintImage(image,radius)
status=PlasmaImage(image,segment_info,attenuate,depth)
RaiseImage(image,raise_info,raised)
noisy_image=ReduceNoiseImage(image)
shaded_image=ShadeImage(image,color_shading,azimuth,elevation)
sharpened_image=SharpenImage(image,factor)
SolarizeImage(image,factor)
spread_image=SpreadImage(image,amount)
swirled_image=SwirlImage(image,degrees)
waved_image=WaveImage(image,amplitude,frequency)
Function 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.
The format of the AddNoiseImage routine is:
noisy_image=AddNoiseImage(image,noise_type)
A description of each parameter follows:
- o noisy_image:
-
Function AddNoiseImage returns a pointer to the image after the noise is
minified. A null image is returned if there is a memory shortage.
- o image:
-
The address of a structure of type Image; returned from ReadImage.
- o noise_type:
-
The type of noise: gaussian, multiplicative gaussian, impulse, laplacian,
or poisson.
Function BlurImage creates a new image that is a copy of an existing one
with the pixels blurred. It allocates the memory necessary for the new
Image structure and returns a pointer to the new image.
BlurImage convolves the pixel neighborhood with this blurring mask:
1 2 1
2 W 2
1 2 1
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.
The format of the BlurImage routine is:
blurred_image=BlurImage(image,factor)
A description of each parameter follows:
- o blurred_image:
-
Function BlurImage returns a pointer to the image after it is blurred. A
null image is returned if there is a memory shortage.
- o image:
-
The address of a structure of type Image; returned from ReadImage.
- o factor:
-
An double value reflecting the percent weight to give to the center pixel
of the neighborhood.
Function 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.
The format of the DespeckleImage routine is:
despeckled_image=DespeckleImage(image)
A description of each parameter follows:
- o despeckled_image:
-
Function DespeckleImage returns a pointer to the image after it is
despeckled. A null image is returned if there is a memory shortage.
- o image:
-
The address of a structure of type Image; returned from ReadImage.
Function EdgeImage creates a new image that is a copy of an existing one
with the edges highlighted. It allocates the memory necessary for the new
Image structure and returns a pointer to the new image.
EdgeImage convolves the pixel neighborhood with this edge detection mask:
-1 0 -1
0 W 0
-1 0 -1
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.
The format of the EdgeImage routine is:
edged_image=EdgeImage(image,factor)
A description of each parameter follows:
- o edged_image:
-
Function EdgeImage returns a pointer to the image after it is edged. A null
image is returned if there is a memory shortage.
- o image:
-
The address of a structure of type Image; returned from ReadImage.
- o factor:
-
An double value reflecting the percent weight to give to the center pixel
of the neighborhood.
Function 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.
EmbossImage convolves the pixel neighborhood with this edge detection mask:
-1 -2 0
-2 0 2
0 2 1
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.
The format of the EmbossImage routine is:
embossed_image=EmbossImage(image)
A description of each parameter follows:
- o embossed_image:
-
Function EmbossImage returns a pointer to the image after it is embossed. A
null image is returned if there is a memory shortage.
- o image:
-
The address of a structure of type Image; returned from ReadImage.
Function 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.
The format of the EnhanceImage routine is:
enhanced_image=EnhanceImage(image)
A description of each parameter follows:
- o enhanced_image:
-
Function EnhanceImage returns a pointer to the image after it is enhanced.
A null image is returned if there is a memory shortage.
- o image:
-
The address of a structure of type Image; returned from ReadImage.
Function ImplodeImage creates a new image that is a copy of an existing one
with the image pixels ``imploded'' by the specified percentage. It
allocates the memory necessary for the new Image structure and returns a
pointer to the new image.
The format of the ImplodeImage routine is:
imploded_image=ImplodeImage(image,factor)
A description of each parameter follows:
- o imploded_image:
-
Function ImplodeImage returns a pointer to the image after it is imploded.
A null image is returned if there is a memory shortage.
- o image:
-
The address of a structure of type Image; returned from ReadImage.
- o factor:
-
An double value that defines the extent of the implosion.
Function 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.
The format of the OilPaintImage routine is:
painted_image=OilPaintImage(image,radius)
A description of each parameter follows:
- o painted_image:
-
Function OilPaintImage returns a pointer to the image after it is
`painted'. A null image is returned if there is a memory shortage.
- o image:
-
The address of a structure of type Image; returned from ReadImage.
- o radius:
-
An unsigned int that is the radius of the circular neighborhood.
Function 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 routine is called.
The format of the PlasmaImage routine is:
status=PlasmaImage(image,segment_info,attenuate,depth)
A description of each parameter follows:
- o status:
-
Function PlasmaImage returns True when the fractal process is complete.
Otherwise False is returned.
- o image:
-
The address of a structure of type Image; returned from ReadImage.
- o segment_info:
-
specifies a structure of type SegmentInfo that defines the boundaries of
the area where the plasma fractals are applied.
- o attenuate:
-
specifies the plasma attentuation factor.
- o depth:
-
this integer values define the plasma recursion depth.
Function RaiseImage lightens and darkens the edges of an image to give a
3-D raised or lower effect.
The format of the RaiseImage routine is:
RaiseImage(image,raise_info,raised)
A description of each parameter follows:
- o image:
-
The address of a structure of type Image.
- o raise_info:
-
Specifies a pointer to a XRectangle which defines the raised region.
- o raised:
-
A value other than zero causes the image to have a 3-D raised effect,
otherwise it has a lowered effect.
Function 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 3 x 3 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 3 x 3 window.
The format of the ReduceNoiseImage routine is:
noisy_image=ReduceNoiseImage(image)
A description of each parameter follows:
- o noisy_image:
-
Function ReduceNoiseImage returns a pointer to the image after the noise is
minified. A null image is returned if there is a memory shortage.
- o image:
-
The address of a structure of type Image; returned from ReadImage.
Function 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.
The format of the ShadeImage routine is:
shaded_image=ShadeImage(image,color_shading,azimuth,elevation)
A description of each parameter follows:
- o shaded_image:
-
Function ShadeImage returns a pointer to the image after it is shaded. A
null image is returned if there is a memory shortage.
- o image:
-
The address of a structure of type Image; returned from ReadImage.
- o color_shading:
-
A value other than zero shades the red, green, and blue components of the
image.
- o azimuth, elevation:
-
A double value that indicates the light source direction.
Function SharpenImage creates a new image that is a copy of an existing one
with the pixels sharpened. It allocates the memory necessary for the new
Image structure and returns a pointer to the new image.
SharpenImage convolves the pixel neighborhood with this sharpening mask:
-1 -2 -1
-2 W -2
-1 -2 -1
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.
The format of the SharpenImage routine is:
sharpened_image=SharpenImage(image,factor)
A description of each parameter follows:
- o sharpened_image:
-
Function SharpenImage returns a pointer to the image after it is sharpened.
A null image is returned if there is a memory shortage.
- o image:
-
The address of a structure of type Image; returned from ReadImage.
- o factor:
-
An double value reflecting the percent weight to give to the center pixel
of the neighborhood.
Function SolarizeImage produces a 'solarization' effect seen when exposing
a photographic film to light during the development process.
The format of the SolarizeImage routine is:
SolarizeImage(image,factor)
A description of each parameter follows:
- o image:
-
The address of a structure of type Image; returned from ReadImage.
- o factor:
-
An double value that defines the extent of the solarization.
Function 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.
The format of the SpreadImage routine is:
spread_image=SpreadImage(image,amount)
A description of each parameter follows:
- o spread_image:
-
Function SpreadImage returns a pointer to the image after it is spread. A
null image is returned if there is a memory shortage.
- o image:
-
The address of a structure of type Image; returned from ReadImage.
- o amount:
-
An unsigned value constraining the ``vicintity'' for choosing a random
pixel to swap.
Function SwirlImage creates a new image that is a copy of an existing one
with the image pixels ``swirled'' at a specified angle. It allocates the
memory necessary for the new Image structure and returns a pointer to the
new image.
The format of the SwirlImage routine is:
swirled_image=SwirlImage(image,degrees)
A description of each parameter follows:
- o swirled_image:
-
Function SwirlImage returns a pointer to the image after it is swirled. A
null image is returned if there is a memory shortage.
- o image:
-
The address of a structure of type Image; returned from ReadImage.
- o degrees:
-
An double value that defines the tightness of the swirling.
Function 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.
The format of the WaveImage routine is:
waved_image=WaveImage(image,amplitude,frequency)
A description of each parameter follows:
- o shaded_image:
-
Function WaveImage returns a pointer to the image after it is shaded. A
null image is returned if there is a memory shortage.
- o image:
-
The address of a structure of type Image; returned from ReadImage.
- o amplitude, frequency:
-
A double value that indicates the amplitude and wavelength of the sine
wave.