I have a raw image where each pixel corresponds to a 16 bits unsigned integer. I am trying to read using the PIL Image.fromstring() function as in the following code:
<
This is an old question, but this might help someone in the future. One of the problems with the original code snippet is that in Image.fromstring('L', imgSize, rawData, 'raw', 'F;16'), the F;16 part works for 'F' mode.
This works for me:
image = Image.fromstring('F', imgSize, rawData, 'raw', 'F;16')
image.convert('L').save('out.png')