如何在不保存到磁盘然后打开 'out.png' 的情况下做到这一点?
r = requests.get(url)
mine,encoded = r.json()[0]['data'].split(',') #if it is segmentation
decoded = base64.decodestring(encoded)
if mine == 'data:image/png;base64':
#TODO do this from memory
g = open("out.png", "w")
g.write(decoded)
g.close()
r = png.Reader('out.png')
print r.read()