1

I would like to save a numpy matrix as a .png image, but I cannot do so using the matplotlib since I would like to retain its original size (which apperently the matplotlib doesn't do so since it adds the scale and white background etc). Anyone knows how I can go around this problem using numpy or the PIL please? Thanks

SeaGull
  • 41
  • 5

1 Answers1

1

Solved using scipy library

import scipy.misc

...(code)

scipy.misc.imsave(name,array,format)

or

scipy.misc.imsave('name.ext',array) where ext is the extension and hence determines the format at which the image will be stored.

SeaGull
  • 41
  • 5