This is sort of re: bug 132 finish blending modes, but would be an addition, so posted here instead.
How about a user-defined blending mode? Apologies if you've already considered this and ruled it out. (I searched the forum but didn't find anything)
You'd need to put a stub for it in PApplet so users could override it
public int blend_user(color c1, color c2) {
// just REPLACE or some other simple default behavior
return c2;
}
and add a constant for it, and all the relevant switch cases in PImage.
The next question would be: Is one user-specified mode enough? I think it should be. The clever user would implement their own blend sub-mode variable and put a switch inside their own blend_user() routine if they wanted multiple user-defined modes.
I'd even offer to write a sample for example/reference docs, if that'd help.
I guess the alternative implementation would be an interface (PBlendFunction or something with only "int blend(int a, int b)") and a reference to the user's class in PApplet, then they could swap classes as desired for multiple modes -- but that's probably a bit hairy for the intended audience?
Anyway, thanks for reading.