|
![](/i/fill.gif) |
Le 04/01/2011 14:19, scott a écrit :
>>> 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".
Just asking a question now:
Why should the interpolation be done in rgb colour space ?
(whatever the gamma used, it would still be a line in a rgb(gamma) space).
Well, may be the word "always" is missing from the question.
(I have been playing a bit with interpolated colors in blobs: rgb, xyv,
xyl, hsv & hsl... not always the same results, but I'm lacking a good
showcase so far).
Interpolating between "red 1" and "green 1", should it always go via a
"yellow 0.5" ? Tuning the gamma in previous formula allow to shift that
a bit, but wouldn't a different color space be simpler and better
instead ? (as an option of the map)
How do you expect to interpolate between "green 1" & "magenta 1"
(opposite rgb value, but both fully saturated : should interpolated be
not saturated ?) ?
Post a reply to this message
|
![](/i/fill.gif) |