请记住打电话,
buf.seek(0)所以
Image.open(buf)从:的开头开始阅读
buf:
import iofrom PIL import Imageimport matplotlib.pyplot as pltplt.figure()plt.plot([1, 2])plt.title("test")buf = io.BytesIO()plt.savefig(buf, format='png')buf.seek(0)im = Image.open(buf)im.show()buf.close()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)