Page 1 of 1
non-[0:1] floating-point GRAY format image
Posted: 2011-10-13T20:49:26-07:00
by fluffles
I have a file of floating-point numbers. They are not contained in the range [0:1]. I want to display them as an image so that the minimum value from the file is black and the maximum value is white. Must I pre-process the data to scale it to the range [0:1] before using Imagemagick for this to work? The command
Code: Select all
display -depth 32 -size 100x100 -define quantum:format=floating-point gray:<filename>
shows black for everything less than 0 and white for everything greater than 1.
Re: non-[0:1] floating-point GRAY format image
Posted: 2011-10-13T22:51:14-07:00
by anthony
There are is a setting for scaling for floating point numbers in input, but no input bias option that I know about. It could be added! But I am not certain how well it works outside of HDRI versions of ImageMagick.
EG -define quantum:scale=65535.0
You will likely need HDRI version of ImageMagick (floating point internal data format), so you can read in the image without clipping, and then 'level' the image to scale the values to a more 'useful' range for display.
http://www.imagemagick.org/Usage/basics/#hdri
tell use more about your input and what you exactly want, perhaps provide a simple small image example, and we can help you more.
Re: non-[0:1] floating-point GRAY format image
Posted: 2011-10-14T14:52:24-07:00
by fluffles
Thank you for the reply. What I want is to display a file that contains floating-point numbers in the range [-b,+w], and have the value '-b' be the black point, and '+w' be the white point. Since it doesn't seem to be possible to achieve this easily with ImageMagick I have decided to instead preprocess the data into the range [0,1] with an external program.
Re: non-[0:1] floating-point GRAY format image
Posted: 2011-10-16T17:33:03-07:00
by anthony
Post a request for floating point bias handling in Bugs. It's probably an easy addition to go with "quantum:scale"