当前位置: 动力学知识库 > 问答 > 编程问答 >

iphone - Blending Three Images into Graphics Context Using Alpha Blend Mode kBlendModeOverlay

问题描述:

Does kCGBlendModeOverlay not work exactly like Photoshop's Overlay blending mode? I'm trying to overlay three images into a graphic context via:

[uiimageGreen drawAtPoint:CGPointMake(x, y) blendMode:kCGBlendModeOverlay alpha:1.0];

[uiimageRed drawAtPoint:CGPointMake(x, y) blendMode:kCGBlendModeOverlay alpha:1.0];

[uiimageBlue drawAtPoint:CGPointMake(x, y) blendMode:kCGBlendModeOverlay alpha:1.0];

In the end, if I overlay just two of the three, the result is much closer to my desired output color in places where both images intersect. Adding the third image, however, causes the first-drawn image's color to be dominant in the resulting mix of colors. (e.g. in the above code, green comes out dominant, when the result should actually be white)

Do you get the same result if you try?

网友答案:

Well, I didn't have Photoshop accessible here, so I couldn't double check, but it turns out I wanted kCGBlendModeScreen ...and that works as desired. It's my flawed memory that apparently doesn't work as desired.

All is well again. :)

分享给朋友:
您可能感兴趣的文章:
随机阅读: