1.用scipy

import scipy

scipy.misc.imsave('test.jpg', img)

 

2.用PIL

from PIL import Image

im = Image.fromarray(img)

im.save("test.jpg")

黄世宇/Shiyu Huang's Personal Page:​​https://huangshiyu13.github.io/​