List Info

Thread: Array to Image to Array




Array to Image to Array
user name
2006-11-07 11:16:29
"Chris S" <chrisspengmail.com> wrote:

> I'm trying to "smooth" a 2D array of floats
by converting it to a
> PIL image, blurring it, then converting it back to an
array.
> However, I can find no practical way to convert arrays
to and
> from PIL. 
> 
> I've found http://effbot.or
g/zone/pil-numpy.htm but it was
> written 8 years ago for Numeric and doesn't appear to
work with
> the current version of Numpy and PIL. Does anyone know
how to
> adapt this code to work correctly with the current
libraries?
> 

Change a.typecode() to a.dtype and import Numeric to from
numpy.core 
import numeric. Fix numeric not to be capitalized.

I'm guessing a bit, I did a similar fix for an earlier
version of 
numpy and a.dtype used to be a.dtypechar, but I think it
should work.

max

_______________________________________________
Image-SIG maillist  -  Image-SIGpython.org
htt
p://mail.python.org/mailman/listinfo/image-sig
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )