Sharpness tutorial

Sharpness

How do you make an image look sharp? Even if your photo is perfectly in focus, it may still look less sharp than other pictures that you may see elsewhere. This is because, usually, pictures are made to look sharp by certain image processing trickery.

An image looks sharp when it gives a suggestion of detail. Most often used is sharpening, but there are other things that make an image look sharper.

Sharpening

Sharpening exaggerates contrast between neighbouring pixels in such a way that details are made more visible. It does not per se add sharpness to an image that was not sharp in the first place, but will rather emphasise detail that is in principle already present. We see that fine, low-contrast, detail may be lost in certain media. Sharpening compensates for this by increasing the contrast in the finest detail. Print media may soften fine detail, which can be compensated by sharpening, and the human eye may also miss detail that can be made visible by sharpening as well. Once you are aware of sharpening and its peculiarities, you may begin to see it everywhere. It is used in printing, scanners, photocopiers, TV, cameras, etc.

EXAMPLE

Original

Left: sharpened. Right: too much sharpening.

Adding noise to increase perceived sharpness

In some cases, noise is added to a picture, which may have the effect of increasing perceived sharpness. Someone mentioned, for example, that film with coarser grain was perceived to be sharper by some. Another example found in digital image processing is aliasing noise when an image is shrunk. When shrinking an image by means of a regular resampling algorithm, such as bilinear, bicubic, or whatever, fine details in the original image that are beyond the resolution of the shrunk image may happen to be shown or hidden in random ways. This is called aliasing. For example, a fine pattern of tiny dots may appear as random speckles in the shrunk image. Aliasing noise actually has the effect of increasing perceived sharpness. Especially in macros, where sharpness is a premium asset, one often sees aliased plus sharpened images, which give an somehwat exaggerated impression of sharpness.

If you use an anti-aliasing algorithm to shrink your images, you will find that the resulting images may look a bit soft in comparison with no anti-aliasing. Then sharpening can quite effectively compensate for the soft look. I typically use a standard sharpening setting to sharpen shrunk images. The end result of antialiasing + sharpening is, as far as I am concerned, better than having aliasing noise `sharpen' your picture.

EXAMPLE.

Original

Shrunk images. These images were shrunk by a factor 0.45, then zoomed by a factor 2 to show detail. From left to right: no anti-aliasing, anti-aliasing, anti-aliasing + sharpening. As you can see,the non-anti-aliased image looks sharper than the anti-aliased one. But the image also nicely illustrates aliasing problems: some of the blades of grass become discontinous, with gaps in them. The anti-aliased version does not have this problem. The final image shows how sharpening may make the anti-aliased image look as sharp as the non-anti-aliased one, but without the aliasing problems.

Sharpening techniques

Typical software provides several sharpening algorithms. We will discuss convolution sharpening and unsharp mask here.

Convolution sharpening means running a convolution matrix over an image. This means that each pixel in the destination image depends linearly on the corresponding pixel in the source image and a number of neighbours. Very easy to understand is convolution blur, which just averages neighbouring pixels to obtain a blurred image. Mathematically, convolution sharpening is exactly the reverse of convolution blurring, that is, subtracting the values of neighbouring pixels from each pixel in an image.

Unsharp mask sharpening works by subtracting a blurred version of an image from that image, and then renormalising for brightness. It is originally known as a darkroom technique rather than a digital image processing technique. Its effectiveness depends on the blurring algorithm that was used to obtain the blurred image. If a convolution blur was used, the unsharp mask is the same as a convolution sharpen. In unsharp mask sharpening, one usually specifies a radius, which stands for the radius of the blur effect. The bigger the radius, the coarser the edges that are sharpened. Unless the blur effect falls off rapidly at the edges of the blur circle, using a big radius may actually mean losing detail. You see this in Gimp, where using a radius of 2 or more will lose detail, and should not be used unless your picture did not have fine detail in the first place.

Sharpening can be effectively done in other spaces than RGB space. In fact, the amplification of chromatic noise may be avoided by sharpening luminance information only. This can be done in a space that separates colour in separate channels such as LAB or HSY.