pure python gaussian blur

Patrick Doyle wpdster at gmail.com
Tue Aug 14 13:26:46 EDT 2007


On 8/14/07, Gerdus van Zyl <gerdusvanzyl at gmail.com> wrote:
> Does anyone have a relatively fast gaussian blur implemented in pure
> python? Below is my attempt but it takes 2.9 seconds for a 320x240
> image. Image comes from byte string: self.array =
> array.array('B',srcstring). Would some sort of matrix multiplication
> be faster? I don't have experience in that.
>
> I don't want to use PIL or http://filters.sourceforge.net/ to avoid
> the 300kb dll just for a simple blur.
>
The one time I tried something similar (implementing a signal
processing function in Python), I found NumPy to be _significantly_
faster -- which makes sense, since all of the matrix arithmetic was
implemented in hard coded, compiled C code instead of interpreted byte
code.

--wpd



More information about the Python-list mailing list