Hi -
I work with Todd and have also been looking at this problem, and I have a solution which is working locally. The problem is that on iOS all of the OS image functions have premultiplied alpha. OF_BLENDMODE_ALPHA sets a glBlendFunc which works only for straight alpha data (which is really hard to come by on iOS).
My solution is to add another blend mode to OF to support premul data, which I call OF_BLENDMODE_PREMULALPHA. I only had to change the two implementations of setBlendMode (ofGLRenderer and ofProgrammableGLRenderer) to have one more entry in the switch statement:
case OF_BLENDMODE_PREMULALPHA:{
glEnable(GL_BLEND);
#ifndef TARGET_OPENGLES
glBlendEquation(GL_FUNC_ADD);
#endif
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
break;
}
This sets the correct glBlendFunc for premul data.
This fixes our problem locally, and I'm happy to get my change back into the OF code if you want it (I'm new here, and don't know that process at all). It should not affect anyone who isn't using the new mode. This will certainly help anyone working on iOS with alpha-bearing images.