im working with a hamamatsu camera, I get a NumPy array and I want to save the array like an image, I can do it to a TIF image but i don't know how to convert the TIF image or the array to get a correct jpg image, I have this code:
img = Image.fromarray(self.val_fin)
if int(self.vTIFF.get()) == 1:
imgTIFF = img.convert('I')
img.save('name1.tiff')
if int(self.vJPG.get()) == 1:
imgJPG = img.convert('RGB')
imgJPG.save('name2.jpg')
Where val_fin is a 32bit array whose negative values have been changed to 0, the result of the jpg image is a black image. Thanks.