I have a single band image with dimensions (62, 62), that ranges from [0, 0.3]. For context it is the NDVI band, calculated by (NVI-Red) / (NVI+Red), where NVI is a band. Can more about it here: https://en.wikipedia.org/wiki/Normalized_difference_vegetation_index
I display my image with cmap=RdYlGn to get:
However, now I want to apply the cmap to ndvi and save it to a new Numpy array. But when I do so, the image display is much different.
How can I apply the cmap.RdYlGn to an image and save the results such that when displaying it shows up the same as when I apply the cmap in imshow?

