|
![](/i/fill.gif) |
Wasn't it Ralph Smith who wrote:
>
>I generated a test gray-level image with hf_gray_16. This created a "image.bmp"
>file. The
>documentation says that this is a "special 16 bit grayscale". I looked into this
>file and it seems
>to be really an 8-bit file with all of the r-g-b values equal for each pixel. Is
>that indeed the
>format of these files? I want to write some c++ code to generate these height
>field files that
>povray can use.
It's not particularly easy to find the bit in the documentation that
says that only the TGA file format supports the storage of hf_gray_16
data.
If you switch on hf_gray_16 and use a file format that can't store it,
then you just get a grey image.
If you look at a hf_gray_16 TGA file with an image editor, you'll see
that all the colours are wrong. The R and G channels are being used to
store high and low bytes of the 16-bit data, but the image editor
doesn't know that. If you look at any image in any other format that's
created with hf_gray_16, you'll see that that doesn't happen.
There are no hf_gray_16 BMP files.
The documentation suggests that you can use an externally generated PPM
file to store suitable 16-bit data, but PPM files created by POVRay with
hf_gray_16 switched on are not in this format (and they're not simple
grey images either). Creating such a PPM image is going to be a little
tricky, because you've also got to somehow set the undocumented marker
that tells POV to treat the RGB data as 16-bit grey (there's nothing in
the height_field syntax that specifies the hf data format, so POV has to
obtain that information from the file).
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
![](/i/fill.gif) |