-
Removing image background by two image comparison
I have two images: one with a subject against a detailed background of trees, and one of the exact same background without the subject. I would like to remove the tree background and be left with the the subject against a transparent background. This is exactly what apple photobooth and ichat do for background replacements. I’m sorry if this problem has been addressed previously, but part of my problem is that I don’t know what to call this process for searching.
I know exactly how this feature should work; I just don’t know how to do it in photoshop. The computer should compare the top layer against the bottom layer; if the pixels are the same (or within a range) the output should be transparency. If pixels are different, the output should be the corresponding pixel from the top layer. I’m two seconds away from trying to code this relatively simple process myself, but I thought I’d try here first over a shifty homemade fix.
I’ve tried a difference matte, but it has been unsuccessful for the following reasons. From the difference matte I get an output that is black where the background is the same, and a sort of combination of the subject and the background for where it is different. This is problematic because then if I try to remove the black, all of the black that was intended to be on the subject is also turned transparent, and there’s also the problem of the subject being semitransparent.
Thanks for your help! (and a link to a previous post that addresses this issue directly would be equally appreciated)