Smoothing and Sharpening

This picture, like any other digital picture is made up of individual coloured squares called pixels.

A standard HD screen has 1920 pixels horizontally and 1080 vertically. The colour in that pixel is produced by mixing red, green and blue light. The information of the intensity of each colour is contained in 1 byte of information

A byte consists of 8 bits, each one of which can be coded to 0 or 1. The total number of levels of  intensity is therefore 2 to the power 8 or 256. So, in total each pixel is defined by 3 numbers each with a range of 256, that is a potential total of  256 x 256 x 256 colours

Digital images can be improved, or altered for a special purpose, by many processes including by smoothing or sharpening which seems contradictory.

Smoothing

Within any picture a few of the pixels will be“wrong”. There will be errors in the recording. For example this blue pixel is darker than the others around it. We can reduce these by smoothing.

The software examines the code of each pixel and makes each an average of those immediately around, like this (the numbers are kept small here to make the example easier to follow):

 

 

 

Pixel code before smoothing

Pixel code after smoothing

Smoothing reduces these odd errors but will also remove other information from the image. Note that the edge between the blue and the head is softened and blurred.

Edges are smoother with no "odd" pixels

 

 

Sharpening does the opposite to smoothing, enhancing the differences between adjacent pixels and increasing the contrast at boundaries between colours. The arithmetic works like this:

Pixel numbers after sharpening

Pixel numbers before sharpening

Edges are more defined

 

The explanation for this is easier to follow on the video but in brief:
The software examines each pixel and the eight pixels in immediate contact. The average value of the eight surrounding pixels is taken from the value of the central subject pixel. The difference is then added to the value of that central subject pixel. The overall effect is to enhance the differences and to produce a sort of halo of light pixels around the dark ones and a ring of darker pixels around light patches.

If you would like to learn more about digital signal processing there are some notes sheets in PDF format which you can download here:

There are two other notes pages here: