This is a topic that I’ve become very interested in, and lead to my involvement in the MyPaint community (a cousin of GIMP) and (trying) to learn programming and math in general. It all started when Anna Timm posted a patch to allow Blue+Yellow to blend into a Green by shifting the Hues more or less manually. I followed the rabbit and eventually found Scott Burns’ work on synthentic and plausible spectral reflectance curves for any RGB color space (He provides detailed information on specifically sRGB).
Armed with this I’ve been working on a patch to MyPaint that does spectral mixing in addition to a bunch of other things (some pretty silly).
My patch largely only affects one particular brush setting; smudge. I haven’t done anything to layer modes, etc. What I do is take the sRGB colors and do a quick lookup in a massive 3DLUT that maps all of sRGB space to unique spectral curves (36 lights). Then the colors are mixed in this 36-light linear cauldron and transformed back to sRGB. The performance is quite good despite the 2GB memory overhead, and the results are incredibly satisfying despite often subtle in appearance. The colors mix in a more intuitive way and makes the “feel” of the paint much more realistic and predictable. What I mean specifically, is that when you blend just a tiny bit of white into a color, it reacts according to your desired blend ratio based on linear input (assuming pressure here). Whereas with non-linear, the blends swing wildly and it is hard to achieve smooth transitions. I suppose when you look at a gamma curve this all makes sense. The same thing happens, I think, with the smudge trail. In non-linear blending the “smear” is very short because the linear distance does not align with the non-linear blending. Distance is linear, right? So now with the smudge/blend ratio changing in-step with the distance the brush traveled, it all works very nicely. At least, that’s what I think is going on.