I\'m trying to read a binary file (8 bit RGB tuples) in Python, do some conversion on it and then write it as a png image. I\'m doing the following:
typeinfo = n
Image needs unsigned bytes, i1 means signed bytes. If the sign is irrelevant (all values between 0 and 127), then this will work:
Image
i1
svimg=im.fromarray(data.astype('uint8'))
If you need the full range 0-255, you should use 'uint8' throughout.
'uint8'