A simple way to blur a
digital image is to apply a "kernel" filter to it.
The
kernel is something like:
1 2 1
2 4 2
1 2 1
(and divide the result by 16)
or, for more blurring:
1 2 4 2 1
2 4 8 4 2
4 8 16 8 4
2 4 8 4 2
1 2 4 2 1
(and divide the result by 100)
These are applied
pixel by pixel. For example, to apply the first kernel to the pixel at (16, 19), first multiply its value by 4, then add the pixels at (15, 18), (17, 20), (15, 20) and (17, 18). Multiply the pixels at (15, 19), (17, 19), (16, 18) and (16, 20) by 2 and add them in. Then divide the whole thing by 16 (the total of all the numbers in the kernel).
Changing the weightings of the kernel elements can produce effects other than blurring; most notable is
sharpening:
0 -1 0
-1 4 -1
0 -1 0
To use these filters on
color images, just decompose the image into
channels and perform the operations on each channel.