Simple function to blur an image?

Hi all - today i found myself wanting to blur an image, and i figured it should be easy to find an example online. But I wasn’t able to find one…

I’m sure that i’m just not searching for the right terms, because I am by no means an expert in image processing - maybe i needed to search for “Gaussian filter” or some other fancy sounding words like that?

Anyway, in lieu of any better answers, I wrote this really naive blur function that I posted to stack overflow, here:

It’s obviously terrible, though, for a bunch of reasons. It’s slow, and it looks bad.

Can people who know more about math and algorithms and image processing come suggest better answers to the question? :slight_smile:

:pray: thanks everyone!

Heh, the downvotes have already started. Gotta love StackOverflow, y’all

I vaguely think I remember this was covered in the MIT computational thinking course? :thinking: I probably should have gone back there and had a look! :sweat_smile:

Have you looked at ImageFiltering.jl?

1 Like

Something like this works for me.

img = load(imfilename)
imgg = imfilter(img, Kernel.gaussian(1))

where you’d increase the value to go blurrier.

I can’t remember which of the Images packages you need to load first…

2 Likes