Only way I know to save images in grayscale is by using imshow, but the problem with this is it displays/prints the image which I don't want. Is there another way to save in grayscale without printing? This is the code:
savethis=gen_imgs
for i in range(r*c):
#img=1
img=plt.imshow(savethis[i, :,:,0],cmap='gray_r')
img=plt.axis('off')
img=plt.savefig('/Users/User/Documents/UCSDproject/SV_cluster/' + str(i)+'.jpg')