POV-Ray : Newsgroups : povray.general : 24 bit heightfields : Re: 24 bit heightfields Server Time
30 Jul 2024 22:26:02 EDT (-0400)
  Re: 24 bit heightfields  
From: Reactor
Date: 11 Dec 2008 20:40:00
Message: <web.4941c0e9869f689f353f48a70@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> "Reactor" <rea### [at] hotmailcom> wrote:
> > I am intrigued by this idea.  I have been using hf_gray_16 in the past, and it
> > usually creates enough levels, but an hf_gray_24 might be pretty cool too.
>
> Well, an hf_gray_24 function would require a new image format: one in which each
> channel stores 24 bits of color information, for a total of 72 bits for the
> entire image. AFAIK, povray only supports a maximum of 16 bits-per-color in a
> handful of formats (PNG is one of them).
>
> The pigment I created will generate 24 bits of heightfield data in 8
> bits-per-color images (the most common format), and 48 bits of heightfield data
> in 16 bits-per-color images.
>
> -Mike

Actually, the hf_gray_16 format doesn't use 16 bits per channel.  It uses the
existing channels. From the docs:
"The TGA and PPM file formats may be used as a storage device for 16 bit numbers
rather than an image file. These formats use the red and green bytes of each
pixel to store the high and low bytes of a height value.
....
PNG format heightfields are usually stored in the form of a grayscale image with
black corresponding to lower and white to higher parts of the height field.
Because PNG files can store up to 16 bits in grayscale images they will be as
smooth as TGA and PPM images. Since they are grayscale images you will be able
to view them with a regular image viewer."

You can use hf_gray_16 with png also, and it results in the same sort of
multicolored output, but only with 16 bits for 65536 levels.  What I meant by
hf_gray_24 wasn't for 24 bits per channel, but a 24 bit grayscale image which,
instead of using only the red and green 8-bit channels for 16 bits, would use
the red, green, and blue channels for a total of 24 bits.  No new image format
would be needed.

-Reactor


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.