POV-Ray : Newsgroups : povray.beta-test : Gamma of interpolated colors in color maps : Re: Gamma of interpolated colors in color maps Server Time
28 Sep 2024 19:51:47 EDT (-0400)
  Re: Gamma of interpolated colors in color maps  
From: clipka
Date: 21 Dec 2010 09:20:26
Message: <4d10b7aa$1@news.povray.org>
Am 21.12.2010 14:45, schrieb scott:
>> Not sure whether I mentioned it here or not, but such a mechanism has
>> already been on my agenda for a while (it will not make it into 3.7.0
>> proper though);
>
> OOC did you decide already which algorithm to use for this? Will it give
> more linear looking gradients between different colours too?

I expect so.

When interpolating between two colors, POV-Ray currently computes 
something along the lines of:

   q = 1-p;
   result = p * color1 + q * color2;

For a "perceptually linear" gradient, the formula would be changed to:

   q = 1-p;
   temp1 = pow(color1, 1/gamma);
   temp2 = pow(color2, 1/gamma);
   tempR = p * color1 + q * color2;
   result = pow(tempR, gamma);

where gamma would be a value around 2.5.

> That's exactly the sort of thing I was thinking of. Maybe Warp will
> argue that the default should be "perceptual" though, and we need a
> "linear" keyword to revert to the existing behaviour.

... except that he'd even argue that "linear" would be the wrong keyword 
for that purpose.

I'll just let him argue then. I'm not reading his newsgroup postings 
anyway, as it would ultimately result in the two of us getting mad at 
each other. Never put two zealots adhering to contradicting dogmata in 
the same room. Fortunately (for me) I'm not in a position of needing to 
be heard to get my will.


Post a reply to this message

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