【发布时间】:2013-11-15 01:31:15
【问题描述】:
使用以下代码从图像中读取像素值后:
import os, sys
import Image
pngfile = Image.open('input.png')
raw = list (pngfile.getdata())
f = open ('output.data', 'w')
for q in raw:
f.write (str (q) + '\n')
f.close ()
如何在读取以原始格式存储的数据后显示图像?有没有 getdata() 的相反功能来实现这一点?
【问题讨论】: