fmw42 wrote:Please note that background removal is hard. In your case, all you are going to get is the color difference. That will not maintain your original color due to the transparency. You will not be able to extract the transparency, I suspect, unless you already know the color.
see http://www.imagemagick.org/Usage/masking/#bg_remove
Essentually you are trying to recover two bits of information. color and transparency of the image that was overlayed on one image to generate the second image.
The problem is two images will not give you that information. The overlay could be full-opaque and exactly the color of the image with the overlay, or it could be partly transparent with stronger colors. Their is no way to tell.
You need more information!
For example
- The result of the overlay on two completely different but known background (two subtractions - two bits of information)
- for knowing that the overlay only used limited colors. For example,
- overlay was a specific, known color with variable transparency,
- or two colors such as white and black of various amounts to generate highlight/shading (such as from a lighting mask technique)