I have a function that creates a monochrome grayscale image that must be export as a 16-bit and 32-bit TIFF file. The Mathematica documentation mentions that these bit depths are supported during Export, but makes no reference as to how to specify them under TIFF or Export.

How is the bit depth specified for this type of export?

  • 3
    $\begingroup$ Import[file, "BitDepth"] gives you the bit depth... so perhaps Export[file, image, "BitDepth" -> 32] might do it? Could you try it? $\endgroup$ – rm -rf Oct 2 '12 at 16:17
  • $\begingroup$ Possibly some variant maybe, this one produces the error "Not a Valid File Specification" +1 Thanks for your suggestion! $\endgroup$ – R Hall Oct 2 '12 at 17:47
  • 1
    $\begingroup$ You might want to look at the 5th example in the documentation for the TIFF format (the one with the Mandrill): reference.wolfram.com/mathematica/ref/format/TIFF.html. $\endgroup$ – chuy Oct 2 '12 at 19:20
  • $\begingroup$ sorry chuy -- I was typing my answer in and didn't notice yours till after I posted. $\endgroup$ – bill s Oct 2 '12 at 19:29
  • 4
    $\begingroup$ The reason the first example did not work was because you forgot to replace "file" with your own file location. It was not meant to be copied, but understood. $\endgroup$ – Searke Oct 2 '12 at 20:47

In the Mathematica documentation for .tiff export


there is an example (about the third one down under Basic Examples)

 Export["real.tiff", img, "BitDepth" -> 32]

where img is the image to export. Seems to work fine.

  • $\begingroup$ The syntax of your solution works very well. +1 and thanks $\endgroup$ – R Hall Oct 2 '12 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.