Tim Lukins
2006-05-04 12:32:34 UTC
Dear All,
I'm a long time user of Magick - but a first time poster! Tried scanning the archives but no luck. Really banging my head off this one, so would really appreciate some help...
Here is the problem: I'm trying to load a floating point TIFF depthmap (captured from a stereo system) - so that I can then (on the command line) alter the colourmap, export in other format, etc.
I can certainly load this file with my own code (using LibTIFF) - confirming that it's TIFFTAG_BITSPERSAMPLE==32 and TIFFTAG_ROWSPERSTRIP=1. etc, etc... It's only one channel (i.e. intensity/grayscale) as well.
Is this the case I wonder? And if so, how can I "rescale" my values so they are acceptable (a simple -fx 'p.intensity*100' doesn't seem to do anything)? It's like Magick has already read the file and decided to round the values to 1...
Cheers in advance!
Tim
I'm a long time user of Magick - but a first time poster! Tried scanning the archives but no luck. Really banging my head off this one, so would really appreciate some help...
Here is the problem: I'm trying to load a floating point TIFF depthmap (captured from a stereo system) - so that I can then (on the command line) alter the colourmap, export in other format, etc.
I can certainly load this file with my own code (using LibTIFF) - confirming that it's TIFFTAG_BITSPERSAMPLE==32 and TIFFTAG_ROWSPERSTRIP=1. etc, etc... It's only one channel (i.e. intensity/grayscale) as well.
convert depthfile.tif -depth 32 -define quantum:format=floating-point -define tiff:rows-per-strip=1 -colorspace GRAY -normalize test.jpg
This seems happy enough, but I just end up with a totally black JPEG (or whatever)! Tried -context-stretch and -colors 255 ,etc, etc. as well.identify -depth 32 -define quantum:format=floating-point -define tiff:rows-per-strip=1 -format "%m:%f %wx%h (depth %z with quantum %q) - type %r with %k colours" depthfile.tif
TIFF:depthfile.tif 2048x3072 (depth 16 with quantum 32) - type PseudoClassGray with 1 colours
Which hints at what I think is the problem. The floating point values in the file are in the range 1.1332 to 1.4500 (with lots of 4th precision values - because the depth is in metres). Thus, Imagemagick converts this to only 1 colour value - perhaps(?) because it expects floating-point values to range across the exponent (e.g. 1.0 - 15324.0 or some other big number).TIFF:depthfile.tif 2048x3072 (depth 16 with quantum 32) - type PseudoClassGray with 1 colours
Is this the case I wonder? And if so, how can I "rescale" my values so they are acceptable (a simple -fx 'p.intensity*100' doesn't seem to do anything)? It's like Magick has already read the file and decided to round the values to 1...
Cheers in advance!
Tim