An image filter is a function that takes in a local spatial neighborhood of pixel values and detects the presence of some pattern in that data.

The goal of convolution is to extract useful features from input data (such as images) and to perform operations such as edge detection, blurring, sharpening, and more complex pattern recognition.

A simple example: the filter in the image below acts as a detector for left edges in the original image.