Saving a Numpy array as an image (instructions)

后端 未结 3 884
囚心锁ツ
囚心锁ツ 2021-02-05 14:16

I found my answer in a previous post: Saving a Numpy array as an image. The only problem being, there isn\'t much instruction on using the PyPNG module.

There are only

3条回答
  •  囚心锁ツ
    2021-02-05 14:51

    It would be best to use scipy for it.

    from scipy.misc import imsave
    # x is the array you want to save 
    imsave("image.png", x)
    

    Full documentation is here: https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.misc.imsave.html

提交回复
热议问题