I am trying to save a numpy array of dimensions 128x128 pixels into a grayscale image. I simply thought that the pyplot.imsave function would do the job but it\'s not, it so
With PIL it should work like this
PIL
import Image I8 = (((I - I.min()) / (I.max() - I.min())) * 255.9).astype(np.uint8) img = Image.fromarray(I8) img.save("file.png")