I have a small problem how to convert an image from matplotlib to PIL

right now doing somthing like this:
------------------------------------------
from scipy import *
from pylab import *
from PIL import Image

a = arange(16384).reshape(128,128)
imsave( "test.png", a, cmap=cm.summer,vmin=0,vmax=16383)
b = Image.open("test.png" )
------------------------------------------

so I have a 128x128 array, get a 128x128 size png by making use of a
colormap and get a 128x128 size PIL image. But so far I could figure out a
way to do this directly without writing a temporary png and reading it
again, which is quite slow. My important point here is to keep the the pixel
resolution.
I would be glad about some help

Regards Hans
-- 
View this message in context: 
http://old.nabble.com/imshow%2C-imsave-to-PIL-image-conversion-tp28736246p28736246.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


------------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to