Blending Three Images into Graphics Context Using Alpha Blend Mode kBlendModeOverlay

Posted by steganous on Stack Overflow See other posts from Stack Overflow or by steganous
Published on 2009-12-22T14:52:18Z Indexed on 2010/05/01 2:07 UTC
Read the original article Hit count: 412

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?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about cocoa-touch