
April 27, 2017
7:38 p.m.
Hi Carlton On Wed, Apr 26, 2017, at 20:14, Carlton Banks wrote:
Is it possible to convert a data set stored as a numpy.ndarray -> plot the data with a colormap , possibly cm.jet. -> and then store the image pixels to a numpy.ndarray.
I hope you're not using jet ;) But here's an example: In [8]: from matplotlib.cm import viridis In [9]: import numpy as np In [10]: image = np.random.random((10, 10)) In [11]: image_mapped = viridis(image) In [12]: image_mapped.min(), image_mapped.max(), image_mapped.shape Out[12]: (0.031496999999999997, 1.0, (10, 10, 4)) Best regards Stéfan