Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.9.2
-
None
-
n/a
Description
Color values stored in computer's memory are in fact a square root of the original (real world) value. In order to mix the colors properly the values should be raised to the second power before the calculation and the result should be square rooted.
Mixing algorithms are usually implemented with following formula:
result = (color1 + color2) / 2
The formula should be modified to:
result = sqrt((color1^2 + color2^2) / 2)
The wrong formula may be seen for example in FastBlur, so my suggestion is to implement the correct color mixing formula in Qt Graphical Effects.
I am not sure whether the added complexity of the formula is worth the natural effect, but the natural effect could always be optional, not implemented in FastBlur, etc.
I attach an example image which shows what I am talking about and project's source code.
Differences are easily visible in the simple red/green image. The transition between colors is dark when using an incorrect mixing algorithm.
It is less visible in more complex image, but the problem is still present. For example look at tall green plants at the right. In the wrong effect they seem to be thinner.