# Blending neighboring pixels together

Disclaimer: This is my first real time using Gimp, so I apologize if this is a basic question.

I'm trying to blend the colors of my pixels together based on the neighboring pixels. For example, consider the following 9 pixels.

``````0 1 2
3 4 5
6 7 8
``````

Suppose that each number represents a value in a color channel. I'm looking for a tool such that given a pixel p, p's new value will the average of its (at most 8) surrounding pixels and itself.

The new values of the pixels above should be, after rounding:

``````2 4 3
4 4 5
5 6 6
``````

Can someone point me towards a tool that can help achieve this?

• Is the look you're going for similar to Gaussian Blur? From what I know of the math behind a Gaussian blur, what you're asking for is roughly that. – Adam Thompson Aug 9 '14 at 19:01
• Yes actually, I'm looking for something similar to the Gaussian Blur. But the Gaussian Blur has a mathematical definition different than what I'm looking for. With that said, I'm willing to experiment with the Gaussian Blur as well. – hlin117 Aug 9 '14 at 20:46

This operation in Image Processing is called aplication of a Convolution Matrix - in GIMP, there is a filter that allows you to do exactly this, experimenting with various weights for each neighboring pixel - just check it under `Filters->Generic->Convolution Matrix`
(if your objective is specifically the average, it is possible it is the operation that is achieved by the simple (not the Gaussian) blur filter - under `filters->blur` - the Convolution Matrix, though, will allow you to achieve exactly what you want)