Page 1 of 1

How to display raw rgb 32 bits floating-point images ?

Posted: 2008-09-02T01:39:55-07:00
by noteed
Hi,

I generate a file with 200*100 "pixels" written as follow (in C) :

/* red */
float red = 1.0f;
fwrite (&red, sizeof(float), 1, file);
/* same for green and blue */

I'd like to display the file but I just get a black picture.
Say the file is named rbg.out, I use the following command :

display -size 200x100 -depth 32 -define quantum:format=floating-point rgb:out.rgb

I use ImageMagick 6.4.3.

What's wrong ?

Thanks a lot.

Re: How to display raw rgb 32 bits floating-point images ?

Posted: 2008-09-02T07:49:21-07:00
by magick
Try this command:
  • display -size 200x100 -depth 32 -define quantum:format=floating-point -define quantum:scale=65536.0 -endian lsb out.rgb

Re: How to display raw rgb 32 bits floating-point images ?

Posted: 2008-09-02T08:29:40-07:00
by noteed
It works, thanks a lot!

But, I don't find the documentation for quantum:scale or -endian on imagemagick.org,
where is it ?

Thank you again.

Re: How to display raw rgb 32 bits floating-point images ?

Posted: 2008-09-02T09:11:51-07:00
by magick
The command line we provided is a temporary fix. You should not need quantum:scale or -endian in your command line and we have applied a patch to ImageMagick to fix the problem for the next release.

Re: How to display raw rgb 32 bits floating-point images ?

Posted: 2008-09-02T10:29:41-07:00
by el_supremo
@magick: should the scale be 65536 or 65535?
and for a Q8 IM, should it be 255.0 or 256.0?

Pete

Re: How to display raw rgb 32 bits floating-point images ?

Posted: 2008-09-02T11:15:25-07:00
by magick
Right. 255 for Q8, 65535 for Q16. However, the latest Subversion trunk patch removes the need to specify the scale.