POV-Ray : Newsgroups : povray.beta-test : Gamma of interpolated colors in color maps : Re: Gamma of interpolated colors in color maps Server Time
29 Jun 2024 06:00:51 EDT (-0400)
  Re: Gamma of interpolated colors in color maps  
From: scott
Date: 4 Jan 2011 08:19:52
Message: <4d231e78@news.povray.org>
>> 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.

OOC why 2.5?  CIELAB uses a value of 3 to computer the "lightness".

Whilst that will be great for greys, it might not work so well for 
colours.  For example if you take a gradient between dark green and dark 
blue, or between purple and orange, I actually think the 3.7 "physically 
linear" method gives a more perceptually linear result currently.


Post a reply to this message

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