[Image-SIG] Array to Image to Array

Christopher Barker Chris.Barker at noaa.gov
Tue Nov 7 00:01:53 CET 2006


You're missing the headers for TK. You probably need to install 
something like python-devel or tcl-devel packages.

but you should be able to use older PIL to do this, just not quite as 
efficiently as with the array interface.


See tostring and fromstring in both PIL and numpy.

-Chris

Chris S 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.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.
> _______________________________________________
> Image-SIG maillist  -  Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig

-- 
Christopher Barker, Ph.D.
Oceanographer
                                     		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov


More information about the Image-SIG mailing list