Commit 00fd0394 authored by David E. DeMarle's avatar David E. DeMarle

bah, I had the scaling and biasing wrong before

parent 4bd86971
......@@ -53,10 +53,10 @@ elif ext == ".Z":
flatarr = np.fromstring(zlib.decompress(compresseddata),
np.float32)
flatarr = ma.masked_invalid(flatarr)
mxval = flatarr.max()
mnval = flatarr.min();
mxval = flatarr.max()
print "MIN AND MAX ARE ", mnval, mxval
flatarr = flatarr.filled(0)*255/(mxval-mnval)+mnval #scale and bias into 0..255 for display
flatarr = ((flatarr.filled(mnval))-mnval)*(255.0/(mxval-mnval)) #scale and bias into 0..255 for display
im = PIL.Image.fromarray(flatarr.reshape((zlib_width, zlib_height)))
else:
im = PIL.Image.open(fname)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment