I have just added Modulo blending mode for Krita, and in addition to that, I have added divisive Modulo. Divisive Modulo is kind like Modulo Addition in a way. Hard to explain. Here’s what Divisive Modulo is:
template<class T>
inline T cfDivisiveModulo(T src, T dst) {
using namespace Arithmetic;
qreal fsrc = scale<qreal>(src);
qreal fdst = scale<qreal>(dst);
if (fsrc == zeroValue<T>()) {
return scale<T>(mod((1.00/epsilon<T>() * fdst),1.00));
}
return scale<T>(mod((1.00/fsrc * fdst),1.00));
}
What this does is divide the maximum channel value by the source layer, and then multiply with the base layer, and then apply modulo operation. So, if source layer is halfValue, you get the equivalent of Modulus Addition if the two layers are the same. I actually think these two makes great blending modes for abstract art, and glitch art. Divisive Modulo can also be used to alter gradient.
Next up is smooth divisive modulo.