I'm writing a png image to file using PyPng, the file is created but it's all black when viewed.Here is my code:
pngImage = numpy.uint16(numpy.zeros((NUM_ROWS, NUM_COLS)))
#code that assigns the pixels
with open(dataFile + ".png", "wb") as outFile:
pngWriter = png.Writer(NUM_COLS, NUM_ROWS, greyscale=True, bitdepth=16)
pngWriter.write(outFile, pngImage)
I'm certain that the code that assigns the pixels works fine. I put a break point on the write call and verified that pngImage has nonzero values. pngImage is a 2D array with integer value for each pixel (not R,G,B tuple).
Am I missing something? Should I be converting the numpy array or something?