meta data for this page

Enhancement – Blur, Sharpen

Blur by 4 pixels (left), the original (middle), and Sharpen with a contrast of 4 (right)

Left: Blur by 4 pixels. Middle: the original, unchanged. Right: Sharpen, with a contrast of 4.

Blur

Blur replaces each pixel with the average of its neighbors inside a chosen shape:

Shape Neighborhood
circle (default) a circle whose diameter is “width” (at least 4)
rectangle a rectangle of “width” × “height” (each at least 1)
diamond a square rotated by 45°, whose diagonal is “width” (at least 2)

If you do not give a size, the neighborhood is 101 × 101 pixels. If you give only the width, the height is the same.

Blur works on byte, integer or floating-point images, and the output is the same type as the input.

Sharpen

Sharpen uses one of two methods:

  • error diffusion: the “contrast” factor sets the amount of sharpening. The larger the factor, the stronger the sharpening; a contrast of 1 means no sharpening. The input must be an 8- or 16-bit integer image, and the output is the same type.
  • unsharp mask: a blurred version of the image is subtracted from the original, which enhances fine details and suppresses broad variations. “sharpness” is the percentage of the blurred image to subtract. “radius” is half the distance over which the blur averages; the smaller the radius, the finer the details that are enhanced. You can choose an integer (8- or 16-bit) or floating-point (32- or 64-bit) output.

Sharpen does not work on floating-point images.