# Image Effects¶

## Blur¶

New in version 0.4.5.

Basic blur operation. The radius argument defines the size of the area to sample, and the sigma defines the standard deviation. For all blur based methods, the best results are given when the radius is larger than sigma. However, if radius is omitted, or zero valued, the value will be selected based off the given sigma property.

with Image(filename="hummingbird.jpg") as img:
img.save(filename="effect-blur.jpg")

 Original Blur

New in version 0.5.3.

This method blurs less intensely around areas of an image with detectable edges, and blurs more intensely for areas without edges. The radius should always be larger than the sigma (standard deviation).

from wand.image import Image

with Image(filename="hummingbird.jpg") as img:


### Gaussian Blur¶

New in version 0.3.3.

Smooths images by performing a Gaussian function. The sigma argument is used to define the standard deviation.

from wand.image import Image

with Image(filename="hummingbird.jpg") as img:
img.gaussian_blur(sigma=3)
img.save(filename="effect-gaussian-blur.jpg")

 Original Gaussian Blur

### Motion Blur¶

New in version 0.5.4.

Performs a Gaussian blur operation along a linear direction to simulate a motion effect. The radius argument should always be larger than the sigma argument, but if the radius is not given (or 0 value) the radius value is selected for you.

from wand.image import Image

with Image(filename="hummingbird.jpg") as img:
img.save(filename="effect-motion-blur.jpg")

 Original Motion Blur

### Rotational Blur¶

New in version 0.5.4.

This method simulates a motion blur by rotating at the center of the image. The larger the angle, the more extreme the blur will be. Unlike the other blur methods, there is no radius or sigma arguments. The angle parameter can be between 0° and 360° degrees with 0° having no effect.

from wand.image import Image

with Image(filename="hummingbird.jpg") as img:
img.rotational_blur(angle=5)
img.save(filename="effect-rotational-blur.jpg")

 Original Rotational Blur

### Selective Blur¶

New in version 0.5.3.

Similar to Image.blur() method, this method will only effect parts of the image that have a contrast below a given quantum threshold.

from wand.image import Image

with Image(filename="hummingbird.jpg") as img:
sigma=3,
threshold=0.25 * img.quantum_range)
img.save(filename="effect-selective-blur.jpg")

 Original Selective Blur

## Despeckle¶

New in version 0.5.0.

Despeckling is one of the many techniques you can use to reduce noise on a given image. Also see Enhance.

from wand.image import Image

with Image(filename="hummingbird.jpg") as img:
img.despeckle()
img.save(filename="effect-despeckle.jpg")

 Original Despeckle

## Edge¶

New in version 0.5.0.

Detects edges on black and white images with a simple convolution filter. If used with a color image, the transformation will be applied to each color-channel.

from wand.image import Image

with Image(filename="hummingbird.jpg") as img:
img.transform_colorspace('gray')
img.save(filename="effect-edge.jpg")

 Original Edge

## Emboss¶

New in version 0.5.0.

Generates a 3D effect that can be described as print reliefs. Like Edge, best results can be generated with grayscale image. Also see Shade.

from wand.image import Image

with Image(filename="hummingbird.jpg") as img:
img.transform_colorspace('gray')
img.save(filename="effect-emboss.jpg")

 Original Emboss

## Kuwahara¶

New in version 0.5.5.

Warning

Class method only available with ImageMagick 7.0.8-41 or greater.

The kuwahara() method applies a smoothing filter to reduce noise in an image, but also preserves edges.

from image.wand import Image

with Image(filename="hummingbird.jpg") as img:
img.save(filename="effect-kuwahara.jpg")

 Original Kuwahara

New in version 0.5.0.

Creates a 3D effect by simulating light from source where aziumth controls the X/Y angle, and elevation controls the Z angle. You can also determine of the resulting image should be transformed to grayscale by passing gray boolean.

from wand.image import Image

with Image(filename="hummingbird.jpg") as img:
azimuth=286.0,
elevation=45.0)


## Sharpen¶

New in version 0.5.0.

Convolves an image with a Gaussian operator to enhance blurry edges into a more distinct “sharp” edge. The radius should always be larger than sigma value. The radius value will be calculated automatically if only sigma is given.

from wand.image import Image

with Image(filename="hummingbird.jpg") as img:
img.save(filename="effect-sharpen.jpg")

 Original Sharpen

New in version 0.5.3.

Just like Image.sharpen(), adaptive sharpen uses a convolve & Gaussian operations to sharpen blurred images. However, the effects of Image.adaptive_sharpen() are more intense around pixels with detectable edges, and less farther away from edges. In the example below, notice the visible changes around the edge of the feathers, and limited changes in the out-of-focus background.

from wand.image import Image

with Image(filename="hummingbird.jpg") as img:


New in version 0.3.4.

Identical to Image.sharpen method, but gives users the control to blend between filter & original (amount parameter), and the threshold. When the amount value is greater than 1.0 more if the sharpen filter is applied, and less if the value is under 1.0. Values for threshold over 0.0 reduce the sharpens.

with Image(filename="hummingbird.jpg") as img:
sigma=4,
amount=1,
threshold=0)


from wand.image import Image