(specific read/write library, no extras) https://github.com/blink1073/tifffile/blob/master/tifffile/tifffile.py
from tifffile import imsave
import numpy as np
# create data
d = np.ndarray(shape=(10,20), dtype=np.float32) # also supports 64bit but ImageJ does not
d[()] = np.arange(200).reshape(10, 20)
# save 32bit float (== single) tiff
imsave('test.tif', d) #, description="hohoho")
PIL clone (larger framework)
from PIL import Image
import numpy as np
# create data
d = np.ndarray(shape=(10,20), dtype=np.float32)
d[()] = np.arange(200).reshape(10, 20)
im = Image.fromarray(d, mode='F') # float32
im.save("test2.tiff", "TIFF")
https://pillow.readthedocs.org/en/3.0.0/handbook/image-file-formats.html#tiff
modes
: https://pillow.readthedocs.org/en/3.0.x/handbook/concepts.html#modes
thx for the samples