One of the basic mechanisms for image enhancement is convolution .
Convolution is the modification of a pixel's value on the basis of the value of neighboring pixels.
For each pixel in the image, the computer scans adjacent pixels to decide whether to change the value of the pixel. For example, a convolution to reduce spot noise in an image might replace each pixel with the average value of its neighbors. Images are convolved by multiplying each pixel and its neighbors by a numerical matrix, called a kernel . This matrix is essentially moved over each pixel in the image, each pixel under the matrix is multiplied by the appropriate matrix value, the total is summed and normalized, and the central pixel is replaced by the result. This procedure is most easily described with a simple example.