I have multiple(in millions) numpy 2-D arrays which need to be saved. One can save an individual image like this:
import numpy as np
import matplotlib.pyplot as plt
surface_profile = np.empty((50,50)) #numpy array to be saved
plt.figure()
plt.imshow(surface_profile)
save_filename='filename.png'
plt.savefig(save_filename)
However this process also displays the image which I don't require. If I keep saving million images like this, I should somehow avoid imshow() function of matplotlib. Any help???
PS: I forgot to mention that I am using Spyder.