32-bit TIFs?

Hello,

Is it possible to save images as 32-bit TIFs? When attempting to save Float32 matrices using TiffImages.jl, I only get 8-bit TIFs.

Thanks!

GMT.jl can do it (but you mast wrap your grid in a GMTgrid type)

G = peaks()       # Just a dumb float32 grid
gmtwrite("G.tif", G)

Are you sure it’s not the program you are using to open the TIFs after?

The following works for me, and opens in ImageJ as a 32-bit TIF at least in Grayscale which is what I normally use.

fn = tempname()*."tif"
img = [Gray(x) for x in range(0,102.3f0; length=1024), y in 1:1024]
TiffImages.save(fn, img)
TiffImages.load(fn) == img # true
maximum(TiffImages.load(fn)) == Gray(102.3f0) # true