POV-Ray : Newsgroups : povray.general : df3 and color-maps : Re: df3 and color-maps Server Time
30 Jul 2024 20:23:28 EDT (-0400)
  Re: df3 and color-maps  
From: Chris B
Date: 28 May 2008 04:49:11
Message: <483d1c87@news.povray.org>
"minzi0815" <mar### [at] eumetsatint> wrote in message 
news:web.483cf7c2faa86b18c32955910@news.povray.org...
> Warp <war### [at] tagpovrayorg> wrote:
>> minzi0815 <mar### [at] eumetsatint> wrote:
>> > So than means, the 65535 possible values are scaled to 256 colors ?
>>
>>   No, it means that you can only specify up to 256 entries in a color 
>> map.
>> Colors are interpolated between these entries and thus the total amount 
>> of
>> colors generated is limitless (well, limited by floating point range).
>>
>> --
>>                                                           - Warp
>
> Well, to be honest, I am getting a little cobfused.
> The question for me is the following:
>
> I want to display a df3 - file that holds 16 Bit measuring values that 
> range
> from 0 to 65535. I want povray to display each value in a different color. 
> How
> is that possible to do ? Do I need a color map at all ?
>

Hi Marcus,

Because of the 256 entry limit on the colour map it's not going to be 
possible to individually specify 65535 separate colour values, but by using 
all 256 entries in the way that I see Warp has indicated you should be able 
to get pretty close to using all the available colours.

If you don't specify a colour map, by default POV-Ray will try to pick a 
different colour/shade between <0,0,0> and <1,1,1> for each value in the df3 
file in a completely linear fashion. This would therefore theoretically 
progress from black to white assigning a different shade of grey to a 
location based on the value from the file as it increases from 0 to 65535.

I say it will 'try' and 'theoretically' assign a different colour because, 
to support that number of grey shades you'd need to support an extremely 
high number of colours, which your hardware probably can't differentiate 
between and which may well run you into the floating point limit of your 
computer. If this happens you may end up with adjacent values from the file 
being assigned the same colour value and even if they have different colour 
values they may look the same when displayed on a screen or on a print.

As you know, by specifying your own colour map you can change the way that 
the algorithm will progress through the colour spectrum as the value from 
the file rises from 0 to 65535, but it still progresses from one specified 
colour value to the next in a completely linear fashion, so your colour map:

color_map{
 [0.2 rgb <0,0,0>]
 [0.3 rgb <1,0,0>]
 [0.4 rgb <0,1,0>]
 [0.5 rgb <0,0,1>]
 [0.8 rgb <1,1,1>]
 }

would progress as Alain described, but it still doesn't hit the full range 
of possible colours. For example you don't get anything on the line of 
colours between pure red and pure blue and when it goes from blue to white 
it only picks colours where the red and green values are equal. By only 
using a small subset of the colours that your screen or printer supports 
you're therefore not getting very close to the optimum number of distinct 
values that you'll be able to see.

You could construct a more complicated colour map that also passes from red 
to blue, from green to yellow, from white to red etc and therefore uses more 
of the available colours. I don't know whether anyone's devised a colour map 
that can pass through a maximum number of available colours. That might be a 
challenge.

Regards,
Chris B.


Post a reply to this message

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