Revision 698350(Back to digest)
Features in Office
Various changes, done a better algorithm.
I'm really sorry for the "poor" results (but, as far as I know, there aren't better ones out there, just Painter, perhaps), but there are good news too.
First, this algorithm seems to work still better than all the previous ones, also because now it always use the KS Color Space (before, because of a bug, I needed to always transform from RGB to KS and viceversa) and it's very fast.
Another important thing. I think it's good to say again why we need K and S values (because it's becoming more and more clear to me to).
K and S values are useful because they've this noticeable property:
c1*K1 + c2*K2 = K3
c1*S1 + c2*S2 = S3
That means, given two colors with (K1,S1) and (K2,S2), their mixture in concentrations c1 and c2 is described by (K3,S3) and it's the WEIGHTED SUM of the components K and S. So, in short: the K and S values of a MIXTURE are the WEIGHTED SUMS of the component K and S.
It's very hard to find out K and S values of a color knowing only his RGB components, because there are infinity (better, currently: infinity^7) K and S couples that give the same RGB values, but only a few of this infinity gives "realistic" results. The "other" way is evaluating them tentatively, but it's not feasible (I'd need a spectroradiometer!).
My work until now has been exactly this: finding an algorithm that gives good K and S values from the RGB definition of the color.
Did I succeed? Almost. Almost because I hoped to do more. For example, it's going to be quite hard to handle illuminant, because I need white points and I don't know how to calculate them, so you've to wait to see good illuminant handling. But "almost" means also that I don't know of any better algorithm, nor I saw any other application that mixes this way.
That's a good point, at least :-) !