# Problem Saving TIFF Images

**URL:** https://discourse.julialang.org/t/problem-saving-tiff-images/7267
**Category:** General Usage
**Created:** [November 23, 2017, 12:17pm UTC](https://discourse.julialang.org/t/problem-saving-tiff-images/7267 "2017-11-23T12:17:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MLackner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mlackner/32/2789_2.png) [@MLackner](https://discourse.julialang.org/u/MLackner)
#### Post date: [November 23, 2017, 12:17pm UTC](https://discourse.julialang.org/t/problem-saving-tiff-images/7267/1 "2017-11-23T12:17:17Z")

</div>

Hi!

I’ve got trouble saving images in .tiff format.  
Am I doing something seriously wrong with this code?  
(I’ve got ImageMagick and QuartzImageIO installed)

```julia
using Images
using TestImages

img = testimage("moonsurface.tiff")
save("img.tiff", img)

```

This gives me the following error asking me if I want to install OMETIFF:

```julia
Error encountered while saving "img.tiff".
Fatal error:
Library "OMETIFF" is not installed but is recommended as a library to load format: ".tiff"
Should we install "OMETIFF" for you? (y/n):

```

If I install OMETIFF it fails too, because OMETIFF only reads tiff files as I understand it.

I think I have to convince FileIO to use ImageMagick or QuartzImageIO? Savers for these are already added. So if i use `add_saver` I get this and calling `save` still asks me to install OMETIFF:

```julia
add_saver(format"TIFF", :ImageMagick)
3-element Array{Symbol,1}:
 :QuartzImageIO
 :ImageMagick  
 :ImageMagick  

```

Edit:

Solved it somehow by using the following:

```julia
io = ("myimg.tiff", "w")
save(Stream(format"TIFF", io), img)
close(io)

```

But now I’ve got an additional problem, because I want to save the image in 16bit. Is there a 16bit tiff saver available anywhere?

---

<div class="post-metadata">

### Author: ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)
#### Post date: [November 23, 2017, 12:43pm UTC](https://discourse.julialang.org/t/problem-saving-tiff-images/7267/2 "2017-11-23T12:43:42Z")

</div>

From my experience with Images, it will save the image in 16 bit if the `eltype` of your image array is 16 bit (i.e. `N0f16`).

---

<div class="post-metadata">

### Author: ![dk-zen](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@dk-zen](https://discourse.julialang.org/u/dk-zen)
#### Post date: [April 20, 2023, 2:30pm UTC](https://discourse.julialang.org/t/problem-saving-tiff-images/7267/3 "2023-04-20T14:30:21Z")

</div>

When I convert the data array to N0f16 type, the image is stored in 16 bits.
