Writing tiff files with depth different than 8 and 16

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
jsanterre
Posts: 31
Joined: 2014-05-09T10:39:21-07:00
Authentication code: 6789

Writing tiff files with depth different than 8 and 16

Post by jsanterre »

Hi there,

I was able to write tiff files with bit depth of 8 and 16, both using Magick++ (6.9.1-4) and from the command line (6.9.1-1) and view those images using other image viewers (Nuke, Paint.Net, Autodesk Maya built-in image viewer and Gimp).

I was also able to write tiff files with bit depth of say, 5, 7, 11 and 13, both using Magick++ (6.9.1-4) and from the command line (6.9.1-1). When trying to view those images using the software from above, I have either weird results or error messages (from Nuke: Sorry, cannot handle images with 7 bit samples.) Of course, when I use ImageMagick imdisplay, the image looks fine.

My concern is that I was not able to view images written by IM with bit depth different than 8 and 16 with any other image viewers. Of course, I know you are not responsible for other software not handling the files written by IM. But beside ImageMagick imdisplay, would it be possible for you to give me the name of one software that would handle tiff images written by ImageMagick with bith depth of say, 7?

Here's the command I use from command line (same results as with Magick++)

Code: Select all

convert bird.tiff -depth 7 bird7_out.tiff


here's a sample image:
https://www.dropbox.com/s/qtrjbd303e8yi ... .tiff?dl=0

and here's the result I got:
https://www.dropbox.com/s/pa7z5ws6umn1n ... .tiff?dl=0

Thank you very much for your help!

Julie
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Writing tiff files with depth different than 8 and 16

Post by snibgo »

I don't know of any software that can read TIFF images with depth other than 8 or 16. But, then, I didn't know IM could write TIFF with depth 7 or 6 or other weird numbers. I'm still learning!

I am curious. Why do you want to use these bit depths?
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Writing tiff files with depth different than 8 and 16

Post by fmw42 »

Does it make any sense to create the 7 or 6 bit depth images in IM. Then convert to 8 or 16 and auto-level the images so that the graylevels stretch to full dynamic range of 8 or 16, but only have 7 or 6 bit depth equivalent number of values.
jsanterre
Posts: 31
Joined: 2014-05-09T10:39:21-07:00
Authentication code: 6789

Re: Writing tiff files with depth different than 8 and 16

Post by jsanterre »

Thanks for your replies!

Here's the reason why I'm interested in those bit depths. I'm developing a lightweight image and video processing tool and I'm currently adding support for different image bit depths. So at the end, I'm not the one who might use those numbers. I simply want my software to be as flexible as possible... Maybe I should stick with bit depth of 8 or 16...

Thanks Fred for the idea. I will need to investigate/try this out and will keep you posted on what we decided to do.

Have a great day!

Julie
Post Reply