Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
    np.savetxt(fname, array) # , fmt='%f')
    np.save(fname, array)
    np.savez(fname, [array1, array2,...])

Save image in 8-bit TIFF file

Code Block
bgColor#DDFFFF
import scipy.misc as scim
    scim.imsave('fname.tiff', arr2d)

Other supported formats: gif, pdf, png, jpeg, eps

 

Save image in 16-bit TIFF file

Code Block
bgColor#DDFFFF
import Image
img = Image.fromarray(arr.astype(np.int16))  # or int32
img.save('fname.tiff')
 

Read image from TIFF file

...