Page 1 of 1

32 bit TIFF to EXR

Posted: 2013-10-26T16:57:34-07:00
by YM_Industries
Hi,
I'm trying to convert a 32 bit TIFF file to an EXR. After a long struggle I've finally compiled ImageMagick with HDRI, OpenEXR, libtiff and a quantum depth of 32 but when I execute

Code: Select all

convert -depth 32 -define quantum:format=floating-point ~/Downloads/dem_asc_half1.tif conv.exr
I get an error stating
convert: Sorry, can not handle images with 32-bit samples. `/home/ym/Downloads/dem_asc_half1.tif' @ error/tiff.c/TIFFErrors/563

I'm converting the image for a friend and I'd really appreciate some help. I'm using Ubuntu 13.04. (Raring Ringtail)

Thanks,
YM

Re: 32 bit TIFF to EXR

Posted: 2013-10-26T17:26:50-07:00
by fmw42
Just to be sure everything is OK, what do you get returned from

convert -version


I don't believe that IM supports the full EXR format, only the "half" (16-bit) format. If that has changed, I am unaware of it. So perhaps try leaving off -depth 32. If that fails, try with Q16 HDRI.

Is the tif file signed 32-bits? If so add -define quantum:format=signed

I have not done your conversion before at Q32, so cannot say if there is a bug or limitation. I usually use Q16 HDRI. But see http://www.imagemagick.org/script/formats.php

At Q16 HDRI, this works

imh convert rose: -evaluate multiply 10 -define quantum:format=floating-point rose.tif
imh convert rose.tif rose.exr


So, try just

convert image.tiff image.exr

or

convert image.tiff -depth 16 image.exr


and see what happens, since I think one usually only needs the -define when writing to tif.

Re: 32 bit TIFF to EXR

Posted: 2013-10-26T18:05:09-07:00
by YM_Industries
fmw42 wrote:Just to be sure everything is OK, what do you get returned from

convert -version
ym@YMEmergency:~/Downloads$ convert -version
Version: ImageMagick 6.8.7-1 2013-10-20 Q32 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: openexr tiff x zlib
fmw42 wrote: I don't believe that IM supports the full EXR format, only the "half" (16-bit) format. If that has changed, I am unaware of it. So perhaps try leaving off -depth 32. If that fails, try with Q16 HDRI.
Hmm, if that's true there might not be any point in what I'm trying to do. My friend already has a 16bit version of the image (which is a heightmap) imported into Blender but the only way to import a 32bit heightmap in Blender is apparently using EXR. The current heightmap is annoyingly jagged which is why he'd like a 32 bit one.
fmw42 wrote: Is the tif file signed 32-bits? If so add -define quantum:format=signed
I'm not sure, but I tried adding that and got the same error message.
fmw42 wrote: I have not done your conversion before at Q32, so cannot say if there is a bug or limitation. I usually use Q16 HDRI. But see http://www.imagemagick.org/script/formats.php

At Q16 HDRI, this works

imh convert rose: -evaluate multiply 10 -define quantum:format=floating-point rose.tif
imh convert rose.tif rose.exr
These don't work, I still get the exact same error.
fmw42 wrote: So, try just

convert image.tiff image.exr

or

convert image.tiff -depth 16 image.exr
Still no joy
fmw42 wrote: and see what happens, since I think one usually only needs the -define when writing to tif.
Yeah, that would make sense actually. I have no idea what I'm doing.


As best as I can tell the error is from within libtiff. Maybe what I'm trying to do isn't possible. :(

Re: 32 bit TIFF to EXR

Posted: 2013-10-26T18:09:31-07:00
by fmw42
Version: ImageMagick 6.8.7-1 2013-10-20 Q32 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: openexr tiff x zlib
Your Features do not show HDRI.

I think you would need to be in Q32 HDRI to have any hope, since Q32 is likely limited to non-negative values.

But I would think that if you tested in Q16 HDRI and it does not work without -depth 32, then I may be right about the half EXR format only.