- NAME
- SYNOPSIS
- FUNCTION DESCRIPTIONS
  - AddNoiseImage
  - BlurImage
  - ColorizeImage
  - DespeckleImage
  - EdgeImage
  - EmbossImage
  - EnhanceImage
  - ImplodeImage
  - MorphImages
  - OilPaintImage
  - PlasmaImage
  - ReduceNoiseImage
  - ShadeImage
  - SharpenImage
  - SolarizeImage
  - SpreadImage
  - SteganoImage
  - StereoImage
  - SwirlImage
  - ThresholdImage
  - WaveImage

# NAME

effects - ImageMagick Image Effects Methods

# SYNOPSIS

Image * AddNoiseImage( const Image *image, const NoiseType noise_type );

Image * BlurImage( const Image *image, const double factor );

void ColorizeImage( Image *image, const char *opacity, const char `*pen_color` );

Image * DespeckleImage( Image `*image` );

Image * EdgeImage( const Image *image, const double factor );

Image * EmbossImage( const Image `*image` );

Image * EnhanceImage( const Image `*image` );

Image * ImplodeImage( Image *image, const double factor );

Image * MorphImages( Image *images, const unsigned int number_frames );

Image * OilPaintImage( Image *image, const unsigned int radius );

unsigned int PlasmaImage( Image *image, const SegmentInfo *segment_info, int attenuate, int depth );

Image * ReduceNoiseImage( const Image `*image` );

Image * ShadeImage( Image *image, const unsigned int color_shading, double azimuth, double elevation );

Image * SharpenImage( const Image *image, const double factor );

void SolarizeImage( Image *image, const double factor );

Image * SpreadImage( Image *image, const unsigned int amount );

Image * SteganoImage( Image *image, Image `*watermark` );

Image * StereoImage( Image *left_image, const Image `*right_image` );

Image * SwirlImage( Image *image, double degrees );

void ThresholdImage( Image *image, const double threshold );

Image * WaveImage( Image *image, const double amplitude, const double wavelength );

# FUNCTION DESCRIPTIONS

## AddNoiseImage

Method AddNoiseImage creates a new image that is a copy of an existing one with noise added. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

The format of the AddNoiseImage method is:

> Image *AddNoiseImage ( const Image *image, const NoiseType noise_type );

A description of each parameter follows:

noisy_image:

  Method AddNoiseImage returns a pointer to the image after the noise is minified. A null image is returned if there is a memory shortage.

image:

  The address of a structure of type Image; returned from ReadImage.

noise_type:

  The type of noise: Gaussian, multiplicative Gaussian, impulse, laplacian, or Poisson.

## BlurImage

Method 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 method is:

> Image *BlurImage ( const Image *image, const double factor );

A description of each parameter follows:

blurred_image:

  Method BlurImage returns a pointer to the image after it is blurred. A null image is returned if there is a memory shortage.

image:

  The address of a structure of type Image; returned from ReadImage.

factor:

  An double value reflecting the percent weight to give to the center pixel of the neighborhood.

## ColorizeImage

Method ColorizeImage colorizes an image with the pen color. The amount of the coloring is controlled with the opacity levels.

The format of the ColorizeImage method is:

> void ColorizeImage ( Image *image, const char *opacity, const char *pen_color );

A description of each parameter follows:

image:

  The address of a structure of type Image; returned from ReadImage.

opaque_color, pen_color:

  A character string that contain an X11 color string.

## DespeckleImage

Method DespeckleImage creates a new image that is a copy of an existing one with the speckle noise minified. It uses the eight hull algorithm described in Applied Optics, Vol. 24, No. 10, 15 May 1985, ``Geometric filter for Speckle Reduction'', by Thomas R Crimmins. Each pixel in the image is replaced by one of its eight of its surrounding pixels using a polarity and negative hull function. DespeckleImage allocates the memory necessary for the new Image structure and returns a pointer to the new image.

The format of the DespeckleImage method is:

> Image *DespeckleImage ( Image *image );

A description of each parameter follows:

despeckled_image:

  Method DespeckleImage returns a pointer to the image after it is despeckled. A null image is returned if there is a memory shortage.

image:

  The address of a structure of type Image; returned from ReadImage.

## EdgeImage

Method 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 -1 -1
      -1  W -1
      -1 -1 -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 method is:

> Image *EdgeImage ( const Image *image, const double factor );

A description of each parameter follows:

edged_image:

  Method EdgeImage returns a pointer to the image after it is edged. A null image is returned if there is a memory shortage.

image:

  The address of a structure of type Image; returned from ReadImage.

factor:

  An double value reflecting the percent weight to give to the center pixel of the neighborhood.

## EmbossImage

Method EmbossImage creates a new image that is a copy of an existing one with the edge highlighted. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

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 method is:

> Image *EmbossImage ( const Image *image );

A description of each parameter follows:

embossed_image:

  Method EmbossImage returns a pointer to the image after it is embossed. A null image is returned if there is a memory shortage.

image:

  The address of a structure of type Image; returned from ReadImage.

## EnhanceImage

Method EnhanceImage creates a new image that is a copy of an existing one with the noise minified. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

EnhanceImage does a weighted average of pixels in a 5x5 cell around each target pixel. Only pixels in the 5x5 cell that are within a RGB distance threshold of the target pixel are averaged.

Weights assume that the importance of neighboring pixels is negately proportional to the square of their distance from the target pixel.

The scan only processes pixels that have a full set of neighbors. Pixels in the top, bottom, left, and right pairs of rows and columns are omitted from the scan.

The format of the EnhanceImage method is:

> Image *EnhanceImage ( const Image *image );

A description of each parameter follows:

enhanced_image:

  Method EnhanceImage returns a pointer to the image after it is enhanced. A null image is returned if there is a memory shortage.

image:

  The address of a structure of type Image; returned from ReadImage.

## ImplodeImage

Method 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 method is:

> Image *ImplodeImage ( Image *image, const double factor );

A description of each parameter follows:

imploded_image:

  Method ImplodeImage returns a pointer to the image after it is imploded. A null image is returned if there is a memory shortage.

image:

  The address of a structure of type Image; returned from ReadImage.

factor:

  A double value that defines the extent of the implosion.

## MorphImages

Method MorphImages morphs a set of images. Both the image pixels and size are linearly interpolated to give the appearance of a meta-morphosis from one image to the next.

The format of the MorphImage method is:

> Image *MorphImages ( Image *images, const unsigned int number_frames );

A description of each parameter follows:

morphed_image:

  Method MorphImages returns an image sequence that has linearly interpolated pixels and size between two input images.

images:

  The address of a structure of type Image; returned from ReadImage.

number_frames:

  This unsigned integer reflects the number of in-between images to generate. The more in-between frames, the smoother the morph.

## OilPaintImage

Method OilPaintImage creates a new image that is a copy of an existing one with each pixel component replaced with the color of greatest frequency in a circular neighborhood.

The format of the OilPaintImage method is:

> Image *OilPaintImage ( Image *image, const unsigned int radius );

A description of each parameter follows:

painted_image:

  Method OilPaintImage returns a pointer to the image after it is `painted'. A null image is returned if there is a memory shortage.

image:

  The address of a structure of type Image; returned from ReadImage.

radius:

  An unsigned int that is the radius of the circular neighborhood.

## PlasmaImage

Method PlasmaImage initializes an image with plasma fractal values. The image must be initialized with a base color and the random number generator seeded before this method is called.

The format of the PlasmaImage method is:

> unsigned int PlasmaImage ( Image *image, const SegmentInfo *segment_info, int attenuate, int depth );

A description of each parameter follows:

status:

  Method PlasmaImage returns True when the fractal process is complete. Otherwise False is returned.

image:

  The address of a structure of type Image; returned from ReadImage.

segment_info:

  specifies a structure of type SegmentInfo that defines the boundaries of the area where the plasma fractals are applied.

attenuate:

  specifies the plasma attenuation factor.

depth:

  this integer values define the plasma recursion depth.

## ReduceNoiseImage

Method ReduceNoiseImage creates a new image that is a copy of an existing one with the noise minified with a noise peak elimination filter. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

The principal function of noise peak elimination filter is to smooth the objects within an image without losing edge information and without creating undesired structures. The central idea of the algorithm is to replace a pixel with its next neighbor in value within a 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 method is:

> Image *ReduceNoiseImage ( const Image *image );

A description of each parameter follows:

noisy_image:

  Method ReduceNoiseImage returns a pointer to the image after the noise is minified. A null image is returned if there is a memory shortage.

image:

  The address of a structure of type Image; returned from ReadImage.

## ShadeImage

Method ShadeImage creates a new image that is a copy of an existing one with the image pixels shaded using a distance light source. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

The format of the ShadeImage method is:

> Image *ShadeImage ( Image *image, const unsigned int color_shading, double azimuth, double elevation );

A description of each parameter follows:

shaded_image:

  Method ShadeImage returns a pointer to the image after it is shaded. A null image is returned if there is a memory shortage.

image:

  The address of a structure of type Image; returned from ReadImage.

color_shading:

  A value other than zero shades the red, green, and blue components of the image.

azimuth, elevation:

  A double value that indicates the light source direction.

## SharpenImage

Method 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 method is:

> Image *SharpenImage ( const Image *image, const double factor );

A description of each parameter follows:

sharpened_image:

  Method SharpenImage returns a pointer to the image after it is sharpened. A null image is returned if there is a memory shortage.

image:

  The address of a structure of type Image; returned from ReadImage.

factor:

  An double value reflecting the percent weight to give to the center pixel of the neighborhood.

## SolarizeImage

Method SolarizeImage produces a 'solarization' effect seen when exposing a photographic film to light during the development process.

The format of the SolarizeImage method is:

> void SolarizeImage ( Image *image, const double factor );

A description of each parameter follows:

image:

  The address of a structure of type Image; returned from ReadImage.

factor:

  An double value that defines the extent of the solarization.

## SpreadImage

Method SpreadImage creates a new image that is a copy of an existing one with the image pixels randomly displaced. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

The format of the SpreadImage method is:

> Image *SpreadImage ( Image *image, const unsigned int amount );

A description of each parameter follows:

spread_image:

  Method SpreadImage returns a pointer to the image after it is spread. A null image is returned if there is a memory shortage.

image:

  The address of a structure of type Image; returned from ReadImage.

amount:

  An unsigned value constraining the ``vicinity'' for choosing a random pixel to swap.

## SteganoImage

Method SteganoImage hides a digital watermark within the image.

The format of the SteganoImage method is:

> Image *SteganoImage ( Image *image, Image *watermark );

A description of each parameter follows:

stegano_image:

  Method SteganoImage returns a pointer to the steganographic image with the watermark hidden. A null image is returned if there is a memory shortage.

image:

  The address of a structure of type Image.

watermark:

  The address of a structure of type Image.

## StereoImage

Method StereoImage combines two images and produces a single image that is the composite of a left and right image of a stereo pair. The left image is converted to gray scale and written to the red channel of the stereo image. The right image is converted to gray scale and written to the blue channel of the stereo image. View the composite image with red-blue glasses to create a stereo effect.

The format of the StereoImage method is:

> Image *StereoImage ( Image *left_image, const Image *right_image );

A description of each parameter follows:

stereo_image:

  Method StereoImage returns a pointer to the stereo image. A null image is returned if there is a memory shortage.

left_image:

  The address of a structure of type Image.

right_image:

  The address of a structure of type Image.

## SwirlImage

Method 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 method is:

> Image *SwirlImage ( Image *image, double degrees );

A description of each parameter follows:

swirled_image:

  Method SwirlImage returns a pointer to the image after it is swirled. A null image is returned if there is a memory shortage.

image:

  The address of a structure of type Image; returned from ReadImage.

degrees:

  An double value that defines the tightness of the swirling.

## ThresholdImage

Method ThresholdImage thresholds the reference image.

The format of the ThresholdImage method is:

> void ThresholdImage ( Image *image, const double threshold );

A description of each parameter follows:

image:

  The address of a structure of type Image; returned from ReadImage.

threshold:

  A double indicating the threshold value.

## WaveImage

Method WaveImage creates a new image that is a copy of an existing one with the image pixels altered along a sine wave. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

The format of the WaveImage method is:

> Image *WaveImage ( Image *image, const double amplitude, const double wavelength );

A description of each parameter follows:

shaded_image:

  Method WaveImage returns a pointer to the image after it is shaded. A null image is returned if there is a memory shortage.

image:

  The address of a structure of type Image; returned from ReadImage.

amplitude, frequency:

  A double value that indicates the amplitude and wavelength of the sine wave.