Image Filter Demo
Image:
Image:
The demo lets you apply "filters" to images. A filter replaces the color of each pixel in the image with a weighted average of the color of the pixel and its neighbors. In this case, only the eight neighbors immediately surrounding the pixel are used. For a "Blur" filter, all the weights are equal, so you get a simple average. Using different weights for different neighbors can give surprising effects, considering how simple the basic algorithm is.
You can look at the source code for the demo to see how the colors of individual pixels can be manipulated.
(The images used in this demo are public domain images from Wikimedia Commons.)