Thanks Jae-Joon and Friedrich

I will try out both solutions.

Regards Hans



Jae-Joon Lee wrote:
> 
> On Tue, Jun 1, 2010 at 2:22 PM, rugspin <piet_par...@web.de> wrote:
>> That's doing it, thought there might be an internal way within
>> matplotlib,
>> but I could figure one.
> 
> If you need more hard-core way of doing this,
> 
> a = np.arange(16384).reshape(128, 128)
> 
> from matplotlib.colors import Normalize
> import matplotlib.cm as cm
> norm = Normalize(vmin=0, vmax=16383)
> cmap = cm.summer
> 
> A = (cmap(norm(a))*255).astype(np.uint8)
> 
> import Image
> pilim = Image.fromarray(A, "RGBA")
> 
> ------------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 

-- 
View this message in context: 
http://old.nabble.com/imshow%2C-imsave-to-PIL-image-conversion-tp28736246p28753655.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