Skip to content

Python3 gaussian blur implementation from scratch

Notifications You must be signed in to change notification settings

xrzi/gaussian_blur

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Gaussian blur

Here is my gaussian blur implementation on python3 from scratch

Currently implemented:

Usage

Use with command line arguments:

python3 gaussian_blur.py /path/to/image.jpg

Other formats are probably supported too, since it depends on PIL for image reading.

By default my 5x5 kernel is used. It's crap, honestly, since it doesn't even generate from gaussian equation, just some semi-random numbers i've come up with.

Use as a module in a script

import gaussian_blur
path = 'image path'
kernel = <your_kernel> # Kernel should be an array of arrays of int values
                       # and should be same lenth by X and by Y

blurred_image = gaussian_blur.blur_image(path, kernel)
blurred_image.show() # Opens a window to show final image

Note, that my implementation is quite slow (mainly because I'm a crap programmer, but also because python3 is slow)

On big (1900x1200) images, processing may take up to 5 minutes

I am open to suggestions on how to improve this

About

Python3 gaussian blur implementation from scratch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages