#!/usr/bin/env python # coding:utf-8 import numpy as np from PIL import Image # im = Image.open('pic/cat.jpg') # im.show() # im.save("pic/cat.png") def save_pic_np(): im = Image.open('pic/cat.jpg') m = np.array(im) # print(m) np.save('demo.npy',m) def read_pic_np(): arr = np.load('demo.npy') img = Image.fromarray(arr) img.show() if __name__ == "__main__": # save_pic_np() #保存图片 read_pic_np() #读取图片
标签:__,Image,pic,保存,im,np,save,numpy,图片 From: https://www.cnblogs.com/boye169/p/17848603.html