transform from Radiance to PPM file

Dear all,
I use the "rtrace" to get the radiance value for each pixel on an image.

I know that there are some related clues inside the Radiance or source
codes, but I do not have much time to look into the Radiance. Could you
please give me some suggestion on how to transform from pixel value to
the value that PPM file needs?

Thanks a lot in advance!

Qing Xu

Qing Xu wrote:

Dear all,
I use the "rtrace" to get the radiance value for each pixel on an image.

I know that there are some related clues inside the Radiance or source
codes, but I do not have much time to look into the Radiance. Could you
please give me some suggestion on how to transform from pixel value to
the value that PPM file needs?

Thanks a lot in advance!

Qing Xu

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

Hi Qing Xu,

rtrace gives floating point values, PPM uses 8bit integers (the format
is flexible and could handle more bits, but that is rarely supported).
So, to render a PPM image with rtrace, you'll have to scale the floating
point values and use something like:
  (echo -e "P3\n1 1\n255" ; ( echo 10 10 10 -1 -1 -1 | rtrace -ov -h
teich.oct | awk '{printf "%d %d %d\n", 255*$1/3e-1, 255*$1/3e-1,
255*$1/3e-1}' ) ) > q
Of course, you'll have to feed appropriate input to rtrace. The whole
exercise seems a bit exotic, what's your reason not to use rpict ?

Should you'll be looking for converting from a pic file (rendered by
rpict or rview) to PPM, use ra_ppm .

regards
Peter

···

--
pab-opto, Freiburg, Germany, www.pab-opto.de

Dear all (especially Dr. Peter),
First of all , thank you very much for giving me timely help.

I am trying to practice the method you told me, but it seems that the
scaling is not working very well. Actually, my point is to render a
region on the image plane pixel by pixel. As long as I can get the
radiance values, I can organize then into a picture (file). So could you
please tell me how to form a radiance picture file (unf or pic) or
something like that from the floating point values produced from
"rtrace"? It is really urgent for me!

Thanks a lot!

Qing Xu

Today's Topics:

   1. Re: transform from Radiance to PPM file (Peter Apian-Bennewitz)

···

--__--__--

Message: 1
Date: Thu, 03 Oct 2002 10:32:19 +0200
From: Peter Apian-Bennewitz <[email protected]>
To: [email protected]
Subject: Re: [Radiance-general] transform from Radiance to PPM file
Reply-To: [email protected]

Hi Qing Xu,

rtrace gives floating point values, PPM uses 8bit integers (the format
is flexible and could handle more bits, but that is rarely supported).
So, to render a PPM image with rtrace, you'll have to scale the floating
point values and use something like:
  (echo -e "P3\n1 1\n255" ; ( echo 10 10 10 -1 -1 -1 | rtrace -ov -h
teich.oct | awk '{printf "%d %d %d\n", 255*$1/3e-1, 255*$1/3e-1,
255*$1/3e-1}' ) ) > q
Of course, you'll have to feed appropriate input to rtrace. The whole
exercise seems a bit exotic, what's your reason not to use rpict ?

Should you'll be looking for converting from a pic file (rendered by
rpict or rview) to PPM, use ra_ppm .

regards
Peter
--
pab-opto, Freiburg, Germany, www.pab-opto.de

--__--__--

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

End of Radiance-general Digest

Hello Qing,

There are many options for getting the output of rtrace and converting it to an image. I would first echo Peter's question, which is why you are not using rpict? If it is because you cannot generate the image you want, be sure you have explored all of the view types (-vt?) and options rpict has to offer from the man page. If you do not have the man pages installed on your system, you can always get them from the online versions (slightly out of date) at LBNL:

  http://radsite.lbl.gov/radiance/refer/index.html#cat2

If you want to create a Radiance picture from rtrace, the simplest method is to specify the horizontal and vertical resolutions on the rtrace command line, and use the -fac output option, like so:

  % rtrace -ov -fac -x $xsiz -y $ysiz $octree < $input_rays > $output_pic

where the variables xsiz, ysiz, octree, input_rays, and output_pic are set appropriately. The second option is to output the standard floating point values, and convert the result with the pvalue program, like so

  % rtrace -ov $octree < $input_rays | pvalue -r -y $yres +x $xres -d > $output_pic

There is no real advantage to using this method, however. And as I said, there is no real advantage to using rtrace over rpict, either, unless you absolutely cannot generate the view you want with rpict.

-Greg