# Unsharp mask

Gilles
Caulier

    caulier dot gilles at free.fr

The digiKam image plugin Unsharp Mask is a tool to enhance sharpness of an image. It uses the Unsharp algorithm taken from the Gimp, and it's copyrighted by Winston Chang.

KDE
Digikam

# Introduction

Out-of-focus photographs, as well as most digitized images, need correction of sharpness. This is due to the digitizing process that must chop a color continuum up in points with slightly different colors: elements thinner than sampling frequency will be averaged into an uniform color. Thus, sharp borders are rendered a little blurred. The same phenomenon appears when printing color dots on paper.

The Unsharp Mask filter sharpens edges of picture elements without increasing noise or blemish. It is the king of the sharpen filters. It works by comparing the image with a blurred version of itself. It is commonly used on photographic images, and it provides a much more pleasing result than the standard sharpen filter. In spite of the rather confusing name, which derives from its origins as a technique used by film developers, its result is to make the image sharper, not "Unsharp".

Some scanners apply a sharpen filter while scanning. It's worth to disable it so that you keep control on your image.

The Unsharp Mask filter is an excellent tool to remove haze from your photographs, see this url for a demonstration.

## Using the plugin

### Unsharp Mask Dialog

The image panel and the original preview help you to pan within the image. The preview window shows the filter output using the current settings.

There are two important parameters, Radius and Amount. The default values often work pretty well, so you should try them first. Increasing either the Radius or the Amount increases the strength of the effect. Don't get carried away, though: if you make the unsharp mask too strong, it will amplify noise in the image and create the impressions of ridges next to sharp edges.

The Radius allows you to set how many pixels on either side of an edge that will be affected by sharpening. High resolution images allow higher radius. You'd better always sharpen an image at its final resolution.

The Amount control is the percentage of the difference between the original and the blur image that is added back into the original. It allows you to set strength of sharpening.

The Threshold control is a fraction of the maximum RGB value, needed to apply the difference amount. It allows you to set the minimum difference in pixel values that indicates an edge where sharpening should be applied. That way, you can protect areas of smooth tonal transition from sharpening, and avoid creation of blemishes in face, sky or water surface.

## The plugin in action

This is an example of how the Unsharp Mask can change your life. The original image is (1) and the corrected image is (2). The unsharp mask was applied with Radius = 6.0, Amount = 0.5, Threshold = 0.0.

### Unsharp Mask Tool in Action