# 32-bit TIFs?

**URL:** <https://discourse.julialang.org/t/32-bit-tifs/116931>\
**Category:** Signal and Image Processing\
**Created:** [July 11, 2024, 11:30pm UTC](https://discourse.julialang.org/t/32-bit-tifs/116931 "2024-07-11T23:30:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![EricChameroy](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@EricChameroy](https://discourse.julialang.org/u/EricChameroy)\
**Post date:** [July 11, 2024, 11:30pm UTC](https://discourse.julialang.org/t/32-bit-tifs/116931/1 "2024-07-11T23:30:27Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [July 12, 2024, 12:00am UTC](https://discourse.julialang.org/t/32-bit-tifs/116931/2 "2024-07-12T00:00:26Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![Daniel\_Berge](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@Daniel\_Berge](https://discourse.julialang.org/u/Daniel_Berge)\
**Post date:** [July 12, 2024, 5:47pm UTC](https://discourse.julialang.org/t/32-bit-tifs/116931/3 "2024-07-12T17:47:49Z")

</div>

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.

```julia
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

```
