Converting 32-bit floating point grayscale raw image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
srulop
Posts: 11
Joined: 2012-02-12T06:43:10-07:00
Authentication code: 8675308

Converting 32-bit floating point grayscale raw image

Post by srulop »

Hello,

I've got raw 16 bits unsigned grayscale images with header. I can successfully convert them to "regular" tiff using:

Code: Select all

convert -endian LSB -depth 16 -size "1024"x"1024"+"8192" gray:try_pic.edf -normalize -compress zip try.tif
But I've also got similar grayscale images in 32 bits floating point, and the following doesn't work:

Code: Select all

convert -endian LSB -depth 32 -size "1024"x"1024"+"8192" gray:try_pic.edf -normalize -compress zip try.tif
After checking this post, tried also this, with no success:

Code: Select all

convert -endian LSB -depth 32 -define quantum:format=floating-point -size "1024"x"1024"+"8192" gray:try_pic.edf -normalize -compress zip try.tif
Can you please suggest something?
Thanks!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting 32-bit floating point grayscale raw image

Post by fmw42 »

What Q level of IM are you using in your compile? Q16? Perhaps you need Q32 or Q32 HDRI.

What does

convert -version

return
srulop
Posts: 11
Joined: 2012-02-12T06:43:10-07:00
Authentication code: 8675308

Re: Converting 32-bit floating point grayscale raw image

Post by srulop »

It was Q16, now compiled with Q32, tried again all commands mentioned before - same results: tiff all transparent.

"convert -version" gives:
Version: ImageMagick 6.8.5-7 2013-10-29 Q32 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC HDRI OpenMP
Delegates: bzlib djvu mpeg fftw fontconfig freetype jng jp2 jpeg lcms lqr lzma openexr pango png ps tiff x xml zlib
Can sucessfuly open with ImageJ with the following options:
Image type: 32-bit real
Width: 1024 pixels
Height: 1024 pixels
Offset to first image: 8192 bytes
Number of images: 1
Gap between images: 0 bytes
Little-endian byte order

What could be wrong?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Converting 32-bit floating point grayscale raw image

Post by snibgo »

srulop wrote:... same results: tiff all transparent.
So IM has added an alpha channel? Weird. What happens if you add "-alpha off" before the output filename?

It might be worth putting the image somewhere like dropbox.com and pasting the URL here, so someone with Q32 HDRI can try. (I don't have Q32.)
snibgo's IM pages: im.snibgo.com
srulop
Posts: 11
Joined: 2012-02-12T06:43:10-07:00
Authentication code: 8675308

Re: Converting 32-bit floating point grayscale raw image

Post by srulop »

Thanks for the replies!

tried (with "-alpha off"):

Code: Select all

convert -endian LSB -depth 32 -define quantum:format=floating-point -size "1024"x"1024"+"8192" gray:au1_6_3085.edf -normalize -alpha off -compress zip try.tif
- same result (transparent .tif).

Here's the raw image (4.1 MB): https://dl.dropboxusercontent.com/u/144 ... 6_3085.edf
And here is the desired result (obtained with ImageJ, with settings mentioned above, and auto normalization) (790 KB): https://dl.dropboxusercontent.com/u/144 ... ESIRED.png

Any ideas?
srulop
Posts: 11
Joined: 2012-02-12T06:43:10-07:00
Authentication code: 8675308

Re: Converting 32-bit floating point grayscale raw image

Post by srulop »

Bumping.
Sorry, but still have no idea how to do it. There must be a way... :?
Post Reply