Page 1 of 1
-depth 32 on a 16 bit tiff produces unexpected results
Posted: 2017-03-01T18:40:28-07:00
by GiantCowFilms
I am attempting to convert a 16 bit tiff to a 32 bit tiff using image magick.
I ran
Code: Select all
magick convert in.tiff -depth 32 out.tiff.
I tried this using Q16 HDRI and Q32 HDRI builds (both of version 7.0.5-0, and one build of an older version 7(something)). The resulting image opened alright in adobe photoshop, but did not work in luminance HDRI, windows photo viewers and several other applications (some outright refused to open it, while other such as windows photo viewer displayed bizarre results). Converting the depth back to 16 bit fixed all the issues however. I'm guessing this has something to do with the encoding.
Any ideas how to fix this? Thanks.
Re: -depth 32 on a 16 bit tiff produces unexpected results
Posted: 2017-03-01T18:54:35-07:00
by snibgo
I think the problem is simply that some software doesn't know hot to properly read 32-bit/channel/pixel TIFFs.
Re: -depth 32 on a 16 bit tiff produces unexpected results
Posted: 2017-03-01T19:24:04-07:00
by GiantCowFilms
snibgo wrote: ↑2017-03-01T18:54:35-07:00
I think the problem is simply that some software doesn't know hot to properly read 32-bit/channel/pixel TIFFs.
When I save the 32 bit out of photoshop it reads its fine - sorry I forgot to mention that.
Re: -depth 32 on a 16 bit tiff produces unexpected results
Posted: 2017-03-01T19:53:36-07:00
by fmw42
Snibgo is probably right.
But see
http://www.imagemagick.org/script/formats.php#supported tif defines
To specify a single-precision floating-point format, use -define quantum:format=floating-point. Set the depth to 64 for a double-precision floating-point format.
Does that help?
To go to 32 bit integers (not floats) you only need Q32 not Q32 HDRI.
But I do not know how this relates to Imagick. I am not sure whether or not it can use HDRI and probably not IM 7.
Imagemagick and Imagick are two different tools. Imagick needs Imagemagick. Imagemagick does not need Imagick.
Re: -depth 32 on a 16 bit tiff produces unexpected results
Posted: 2017-03-01T20:28:10-07:00
by snibgo
I'll mention that Gimp 2.9.3 (development version) is happy to read 32-bit integer, 32-bit float and 64-bit float images made by ImageMagick, and correctly reports them as such, and shows good pictures on the screen.
Microsoft Windows Photo Viewer reads 32-bit images but shows a bad picture, and for 64-bit images it says it can't read the file.
GiantCowFilms wrote:When I save the 32 bit out of photoshop it reads its fine - sorry I forgot to mention that.
If this means that PS can create 32-bit (integer or float?) images that some software (which software?) can read, but ImageMagick can't create them, perhaps there is something for IM developers to look at.
If so, perhaps you can provide URLs to sample files.
As Fred says, Imagick is a different beast, and might do something bad.
Re: -depth 32 on a 16 bit tiff produces unexpected results
Posted: 2017-03-02T10:07:14-07:00
by GiantCowFilms
snibgo wrote: ↑2017-03-01T20:28:10-07:00
I'll mention that Gimp 2.9.3 (development version) is happy to read 32-bit integer, 32-bit float and 64-bit float images made by ImageMagick, and correctly reports them as such, and shows good pictures on the screen.
Microsoft Windows Photo Viewer reads 32-bit images but shows a bad picture, and for 64-bit images it says it can't read the file.
GiantCowFilms wrote:When I save the 32 bit out of photoshop it reads its fine - sorry I forgot to mention that.
If this means that PS can create 32-bit (integer or float?) images that some software (which software?) can read, but ImageMagick can't create them, perhaps there is something for IM developers to look at.
If so, perhaps you can provide URLs to sample files.
As Fred says, Imagick is a different beast, and might do something bad.
Photoshop saves them as float. And when I set them to float it worked in all the software. Apparently these programs do not like 32 bit integer tiffs. Thanks for all the help.