Adam Gray

Blog
04/03/2024

Convolution Filters

Blurring, changing colours, how does that work?!

Oh, it’s basically matrix math? cool!

That was essentially my experience 7+ years ago when I set out to answer this question. All thanks to this article

I built a small repository that demonstrated different convolution filters over a single image. Basically I render an image onto a canvas, get the image data (as RGBA values), then run a convolution filter across the entire image, manipulating a cluster of pixels at a time until the entire image is updated. Then, render that buffer to the canvas to see the result!

Original

Outrun

Motion Blur

Grayscale, Sepia, and Gaussian