POV-Ray : Newsgroups : povray.general : 16-bit greyscale using rg values? Server Time
2 Aug 2024 12:22:41 EDT (-0400)
  16-bit greyscale using rg values? (Message 1 to 3 of 3)  
From: brandon
Subject: 16-bit greyscale using rg values?
Date: 1 Nov 2004 15:55:00
Message: <web.4186a25f26a673e570f077560@news.povray.org>
Hey,

The documentation mentions that POV-Ray can use the red and green color
values from a TGA image for the high and low bytes of a 16 bit value for a
heightfield. Has anyone made a patch to allow this to be done with other
formats, in my case, windows bitmaps?

This seems like it would be fairly trivial. Maybe I'll have to bust out a C
compiler ;)

I know PPM's can be used, but they're so space inefficient for my little
hard drive.

-brandon


Post a reply to this message

From: Christopher James Huff
Subject: Re: 16-bit greyscale using rg values?
Date: 2 Nov 2004 13:31:09
Message: <cjameshuff-6F2394.13310102112004@news.povray.org>
In article <web.4186a25f26a673e570f077560@news.povray.org>,
 "brandon" <moc.tibroni@drut backwards> wrote:

> I know PPM's can be used, but they're so space inefficient for my little
> hard drive.

You're space limited, and using windows BMPs?
How about putting them in PNG format? IIRC, 16 bit grayscale PNG will 
work in height fields, and will be far smaller than red-green encoded 16 
bit BMP. Or just use TGA...BMP doesn't have any advantages over it.

Anyway, you can use it with any file format. Simply make a pigment 
function using the image in an image_map, then make a scalar function 
using the .hf feature or combine the channels yourself. Then use that 
function in an isosurface, HF mesh, or height field.

#declare PigFn = function {pigment {image_map {...}}};
#declare HeightFn = function {PigFn(x, y, z).hf};

You could even go further, and have 24 bit height values encoded in all 
three channels. Or combine multiple images in useful ways, or mix them 
with built-in patterns or mathematical functions.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

From: brandon
Subject: Re: 16-bit greyscale using rg values?
Date: 4 Nov 2004 18:00:01
Message: <web.418ab4551788a3d78e133600@news.povray.org>
Christopher James Huff <cja### [at] earthlinknet> wrote:
> In article <web.4186a25f26a673e570f077560@news.povray.org>,
>  "brandon" <moc.tibroni@drut backwards> wrote:
>
> > I know PPM's can be used, but they're so space inefficient for my little
> > hard drive.
>
> You're space limited, and using windows BMPs?
> How about putting them in PNG format? IIRC, 16 bit grayscale PNG will
> work in height fields, and will be far smaller than red-green encoded 16
> bit BMP. Or just use TGA...BMP doesn't have any advantages over it.
>
> Anyway, you can use it with any file format. Simply make a pigment
> function using the image in an image_map, then make a scalar function
> using the .hf feature or combine the channels yourself. Then use that
> function in an isosurface, HF mesh, or height field.
>
> #declare PigFn = function {pigment {image_map {...}}};
> #declare HeightFn = function {PigFn(x, y, z).hf};
>
> You could even go further, and have 24 bit height values encoded in all
> three channels. Or combine multiple images in useful ways, or mix them
> with built-in patterns or mathematical functions.
>
> --
> Christopher James Huff <cja### [at] earthlinknet>
> http://home.earthlink.net/~cjameshuff/
> POV-Ray TAG: <chr### [at] tagpovrayorg>
> http://tag.povray.org/


I'll do what you said and use 24 bit! :D

Thank you for all the info!
-Brandon


Post a reply to this message

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