写法如下所示: from PIL import Image import numpy as np img_pil = Image.fromarray(img_arr) 可以通过附上img_pil.show()语句来检验结果。