data = random.random((2, 2))
img1 = Image.fromarray(data)
img1.save('test.tiff')
img2 = Image.open('test.tiff')
f1 = list(img1.getdata())
f2 = list(img2.getdata())
print(f1 == f2)
print(f1)
How do I save a mode 'F' image? (Python/PIL)