[Image-SIG] Array to Image to Array

Chris S chrisspen at gmail.com
Mon Nov 6 19:38:44 CET 2006


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.org/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?

I also noticed that PIL 1.1.6b2 has a new fromarray method, but all my
attempts to compile it on FC5 fail with:

_imagingtk.c:20:16: error: tk.h: No such file or directory
_imagingtk.c:23: error: expected ')' before '*' token
_imagingtk.c:31: error: expected specifier-qualifier-list before 'Tcl_Interp'
_imagingtk.c: In function '_tkinit':
_imagingtk.c:37: error: 'Tcl_Interp' undeclared (first use in this function)
_imagingtk.c:37: error: (Each undeclared identifier is reported only once
_imagingtk.c:37: error: for each function it appears in.)
_imagingtk.c:37: error: 'interp' undeclared (first use in this function)
_imagingtk.c:45: error: expected expression before ')' token
_imagingtk.c:51: error: 'TkappObject' has no member named 'interp'
_imagingtk.c:55: warning: implicit declaration of function 'TkImaging_Init'
error: command 'gcc' failed with exit status 1

Any help resolving this issue is appreciated.

Thanks,
Chris

P.S. Sorry if this is double posted. I tried sending from Gmane but
when the post didn't appear after several hours I subscribed directly
to the list instead.


More information about the Image-SIG mailing list