views:

384

answers:

1

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?

A: 

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. :)

steganous