[Image-SIG] Filter PIL images with arbitrary kernels via numpy and FFT

Connelly Barnes connellybarnes at yahoo.com
Thu Sep 13 07:57:02 CEST 2007


The Python Imaging Library currently only supports 3x3 and 5x5 image filters.  Here's a module
which uses numpy and the FFT to compute filters of arbitrary size:

  http://barnesc.blogspot.com/2007/09/filter-numpy-images-with-fft-python.html

For an image and filter which contain a total of N pixels overall, it runs in O(N*log(N)) time;
however, numpy's FFT isn't too fast and so in practice other methods may be more appropriate to
compute filters quickly, as described in the blog post linked above.

Connelly Barnes
http://www.connellybarnes.com/



       
____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase.yahoo.com/


More information about the Image-SIG mailing list