문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top