# ImageMagick: MagickCore, C API for ImageMagick: Add an Effect
ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (about 100) including GIF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, TIFF, and DPX. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you can freely use, copy, modify, and distribute. Its license is compatible with the [cut: 1167 characters, first 599 kept]
Author: ImageMagick Studio LLC
Keywords: magickcore, c, api, for, imagemagick:, add, an, effect, ImageMagick, ImageMagic, MagickCore, MagickWand, PerlMagick, Magick++, RMagick, PythonMagick, JMagick, TclMagick, Image, Magick, Magic, Wand

## AdaptiveBlurImage

AdaptiveBlurImage() adaptively blurs the image by blurring less intensely near image edges and more intensely far from edges. We blur 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 AdaptiveBlurImage() selects a suitable radius for you.

The format of the AdaptiveBlurImage method is:

      Image *AdaptiveBlurImage(const Image *image,const double radius,
        const double sigma,ExceptionInfo *exception)
      Image *AdaptiveBlurImageChannel(const Image *image,
        const ChannelType channel,double radius,const double sigma,
        ExceptionInfo *exception)

A description of each parameter follows:

##### image

The image.

##### channel

The channel type.

##### radius

The radius of the Gaussian, in pixels, not counting the center pixel.

##### sigma

The standard deviation of the Laplacian, in pixels.

##### exception

Return any errors or warnings in this structure.

## AdaptiveSharpenImage

AdaptiveSharpenImage() adaptively sharpens the image by sharpening more intensely near image edges and less intensely far from edges. We sharpen 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 AdaptiveSharpenImage() selects a suitable radius for you.

The format of the AdaptiveSharpenImage method is:

      Image *AdaptiveSharpenImage(const Image *image,const double radius,
        const double sigma,ExceptionInfo *exception)
      Image *AdaptiveSharpenImageChannel(const Image *image,
        const ChannelType channel,double radius,const double sigma,
        ExceptionInfo *exception)

A description of each parameter follows:

##### image

The image.

##### channel

The channel type.

##### radius

The radius of the Gaussian, in pixels, not counting the center pixel.

##### sigma

The standard deviation of the Laplacian, in pixels.

##### exception

Return any errors or warnings in this structure.

## AddNoiseImage

AddNoiseImage() adds random noise to the image.

The format of the AddNoiseImage method is:

      Image *AddNoiseImage(const Image *image,const NoiseType noise_type,
        ExceptionInfo *exception)
      Image *AddNoiseImageChannel(const Image *image,const ChannelType channel,
        const NoiseType noise_type,ExceptionInfo *exception)

A description of each parameter follows:

##### image

The image.

##### channel

The channel type.

##### noise_type

The type of noise: Uniform, Gaussian, Multiplicative, Impulse, Laplacian, or Poisson.

##### exception

Return any errors or warnings in this structure.

## BlurImage

BlurImage() blurs an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, the radius should be larger than sigma. Use a radius of 0 and BlurImage() selects a suitable radius for you.

BlurImage() differs from GaussianBlurImage() in that it uses a separable kernel which is faster but mathematically equivalent to the non-separable kernel.

The format of the BlurImage method is:

      Image *BlurImage(const Image *image,const double radius,
        const double sigma,ExceptionInfo *exception)
      Image *BlurImageChannel(const Image *image,const ChannelType channel,
        const double radius,const double sigma,ExceptionInfo *exception)

A description of each parameter follows:

##### image

The image.

##### channel

The channel type.

##### radius

The radius of the Gaussian, in pixels, not counting the center pixel.

##### sigma

The standard deviation of the Gaussian, in pixels.

##### exception

Return any errors or warnings in this structure.

## DespeckleImage

DespeckleImage() reduces the speckle noise in an image while perserving the edges of the original image.

The format of the DespeckleImage method is:

      Image *DespeckleImage(const Image *image,ExceptionInfo *exception)

A description of each parameter follows:

##### image

The image.

##### exception

Return any errors or warnings in this structure.

## EdgeImage

EdgeImage() finds edges in an image. Radius defines the radius of the convolution filter. Use a radius of 0 and EdgeImage() selects a suitable radius for you.

The format of the EdgeImage method is:

      Image *EdgeImage(const Image *image,const double radius,
        ExceptionInfo *exception)

A description of each parameter follows:

##### image

The image.

##### radius

the radius of the pixel neighborhood.

##### exception

Return any errors or warnings in this structure.

## EmbossImage

EmbossImage() returns a grayscale image with a three-dimensional effect. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and Emboss() selects a suitable radius for you.

The format of the EmbossImage method is:

      Image *EmbossImage(const Image *image,const double radius,
        const double sigma,ExceptionInfo *exception)

A description of each parameter follows:

##### image

The image.

##### radius

the radius of the pixel neighborhood.

##### sigma

The standard deviation of the Gaussian, in pixels.

##### exception

Return any errors or warnings in this structure.

## GaussianBlurImage

GaussianBlurImage() blurs an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, the radius should be larger than sigma. Use a radius of 0 and GaussianBlurImage() selects a suitable radius for you

The format of the GaussianBlurImage method is:

      Image *GaussianBlurImage(const Image *image,onst double radius,
        const double sigma,ExceptionInfo *exception)
      Image *GaussianBlurImageChannel(const Image *image,
        const ChannelType channel,const double radius,const double sigma,
        ExceptionInfo *exception)

A description of each parameter follows:

##### radius

the radius of the Gaussian, in pixels, not counting the center pixel.

##### channel

The channel type.

##### sigma

the standard deviation of the Gaussian, in pixels.

##### exception

Return any errors or warnings in this structure.

## MedianFilterImage

MedianFilterImage() 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.

The algorithm was contributed by Mike Edmonds and implements an insertion sort for selecting median color-channel values. For more on this algorithm see "Skip Lists: A probabilistic Alternative to Balanced Trees" by William Pugh in the June 1990 of Communications of the ACM.

The format of the MedianFilterImage method is:

      Image *MedianFilterImage(const Image *image,const double radius,
        ExceptionInfo *exception)

A description of each parameter follows:

##### image

The image.

##### radius

The radius of the pixel neighborhood.

##### exception

Return any errors or warnings in this structure.

## MotionBlurImage

MotionBlurImage() simulates motion blur. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and MotionBlurImage() selects a suitable radius for you. Angle gives the angle of the blurring motion.

Andrew Protano contributed this effect.

The format of the MotionBlurImage method is:

          Image *MotionBlurImage(const Image *image,const double radius,
      const double sigma,const double angle,ExceptionInfo *exception)

A description of each parameter follows:

##### image

The image.

##### radius

The radius of the Gaussian, in pixels, not counting the center pixel.

##### sigma

The standard deviation of the Gaussian, in pixels.

##### angle

Apply the effect along this angle.

##### exception

Return any errors or warnings in this structure.

## PreviewImage

PreviewImage() tiles 9 thumbnails of the specified image with an image processing operation applied with varying parameters. This may be helpful pin-pointing an appropriate parameter for a particular image processing operation.

The format of the PreviewImages method is:

      Image *PreviewImages(const Image *image,const PreviewType preview,
        ExceptionInfo *exception)

A description of each parameter follows:

##### image

The image.

##### preview

The image processing operation.

##### exception

Return any errors or warnings in this structure.

## RadialBlurImage

RadialBlurImage() applies a radial blur to the image.

Andrew Protano contributed this effect.

The format of the RadialBlurImage method is:

          Image *RadialBlurImage(const Image *image,const double angle,
      ExceptionInfo *exception)
          Image *RadialBlurImageChannel(const Image *image,const ChannelType channel,
      const double angle,ExceptionInfo *exception)

A description of each parameter follows:

##### image

The image.

##### channel

The channel type.

##### angle

The angle of the radial blur.

##### exception

Return any errors or warnings in this structure.

## ReduceNoiseImage

ReduceNoiseImage() smooths the contours of an image while still preserving edge information. The algorithm works by replacing each pixel with its neighbor closest in value. A neighbor is defined by radius. Use a radius of 0 and ReduceNoise() selects a suitable radius for you.

The format of the ReduceNoiseImage method is:

      Image *ReduceNoiseImage(const Image *image,const double radius,
        ExceptionInfo *exception)

A description of each parameter follows:

##### image

The image.

##### radius

The radius of the pixel neighborhood.

##### exception

Return any errors or warnings in this structure.

## ShadeImage

ShadeImage() shines a distant light on an image to create a three-dimensional effect. You control the positioning of the light with azimuth and elevation; azimuth is measured in degrees off the x axis and elevation is measured in pixels above the Z axis.

The format of the ShadeImage method is:

      Image *ShadeImage(const Image *image,const MagickBooleanType gray,
        const double azimuth,const double elevation,ExceptionInfo *exception)

A description of each parameter follows:

##### image

The image.

##### gray

A value other than zero shades the intensity of each pixel.

##### azimuth, elevation

Define the light source direction.

##### exception

Return any errors or warnings in this structure.

## SharpenImage

SharpenImage() sharpens the 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 SharpenImage() selects a suitable radius for you.

Using a separable kernel would be faster, but the negative weights cancel out on the corners of the kernel producing often undesirable ringing in the filtered result; this can be avoided by using a 2D gaussian shaped image sharpening kernel instead.

The format of the SharpenImage method is:

          Image *SharpenImage(const Image *image,const double radius,
      const double sigma,ExceptionInfo *exception)
          Image *SharpenImageChannel(const Image *image,const ChannelType channel,
      const double radius,const double sigma,ExceptionInfo *exception)

A description of each parameter follows:

##### image

The image.

##### channel

The channel type.

##### radius

The radius of the Gaussian, in pixels, not counting the center pixel.

##### sigma

The standard deviation of the Laplacian, in pixels.

##### exception

Return any errors or warnings in this structure.

## SpreadImage

SpreadImage() is a special effects method that randomly displaces each pixel in a block defined by the radius parameter.

The format of the SpreadImage method is:

      Image *SpreadImage(const Image *image,const double radius,
        ExceptionInfo *exception)

A description of each parameter follows:

##### image

The image.

##### radius

Choose a random pixel in a neighborhood of this extent.

##### exception

Return any errors or warnings in this structure.

## UnsharpMaskImage

UnsharpMaskImage() sharpens one or more image channels. 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 UnsharpMaskImage() selects a suitable radius for you.

The format of the UnsharpMaskImage method is:

          Image *UnsharpMaskImage(const Image *image,const double radius,
      const double sigma,const double amount,const double threshold,
      ExceptionInfo *exception)
          Image *UnsharpMaskImageChannel(const Image *image,
      const ChannelType channel,const double radius,const double sigma,
      const double amount,const double threshold,ExceptionInfo *exception)

A description of each parameter follows:

##### image

The image.

##### channel

The channel type.

##### radius

The radius of the Gaussian, in pixels, not counting the center pixel.

##### sigma

The standard deviation of the Gaussian, in pixels.

##### amount

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.

##### exception

Return any errors or warnings in this structure.

Discourse Server • Mailing Lists • ImageMagick Studio