From: Jae-Joon L. <lee...@gm...> - 2010-06-01 22:39:32
|
On Tue, Jun 1, 2010 at 2:22 PM, rugspin <pie...@we...> 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") |