I’ve following two images the background may be totally different image, e.g. not just plain color.

So basically I want to get the diff image of these two images i.e.

The diff image of two images is the image with the same size but the
pixels are set to be transparent that haven’t been changed. The difference image is constructed from the diff pixels with the color from the second image
I’m looking for the solution based on Core Graphics techniques, please don’t suggest to run all over the pixels in loop. I do care about the performance.
As I’m new to Quartz I would like to know is it possible to achieve this with masks ?
Or please suggest another approach !
Update on using difference blending mode
Actually if I use the difference blending mode it doesn’t solve my problem as it doesn’t keep right colors of the pixels. If I apply difference blend mode to above 2 images I’ll get following

Which seems to have inverted colors for the pixels and then if I invert them I get following

Which actually is not what I wanted, as the pixel colors are totally different
Thanks to @David Rönnqvist for the tip I’ve got my problem solved +2 to him 🙂
I’ve posted the solution in my blog here http://levonp.blogspot.com/2012/05/quartz-getting-diff-images-of-two.html