2

I want to be able to overlay a semi-transparent PNG with a single colour using an arbitrary blending and keep the alpha.

I'm aware of this solution:

How to tint a transparent PNG image in iPhone?

Unfortunately, DestinationIn / SourceOut / Mask all display noticeable visual artefacts in the alpha regions. This is especially noticeable when layering graphics:

Example on the difference

Aside from using Core Graphics, I've tried CoreImage, which does not display any artefacts in CIMultiplyCompositing, but has no corresponding filter for the other Core Graphics blend modes (such as Screen and Overlay)

I've also worked with GPUImage but encountered the same visual artefacts, although this appears to be a bug in the library.

4

1 回答 1

0

I found and fixed the bug in GPUImage which was causing the problems. I then manually implemented all the blendings as shaders.

于 2013-04-01T14:27:12.163 回答