0

I'm using matplotlib to overlay images and show them, and it works great. Yet, how can I save this image to file instead of showing it?

plt.figure(figsize=(15,15))
plt.imshow(image_A, cmap='Reds', interpolation ='nearest', origin ='lower')
plt.imshow(image_B, cmap='Purples', interpolation ='nearest', origin ='lower', alpha=0.5)

Comment: since I need to save an overlayed (merged) image and not a single image imsave does not work for me.

Thanks!

Roy Granit
  • 325
  • 2
  • 20
  • 1
    [savefig](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.savefig.html) or [save the rgb data](https://stackoverflow.com/questions/7821518/matplotlib-save-plot-to-numpy-array) with your favorite library – Quang Hoang Dec 13 '21 at 14:56
  • @QuangHoang unfortunately no.. since I need to save an overlayed image and not a single image.. therefore imsave does not work for me. – Roy Granit Dec 13 '21 at 15:00
  • But the suggestion was not to use `imsave`. – BigBen Dec 13 '21 at 17:36

0 Answers0