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

4

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.