How to save the DIFFERENCES between two images ?
Posted: 2010-02-16T14:53:31-07:00
The subject may not be clear enough to capture what I want to do.
I have two images:
image1.png -- this image is a photo, and is a scenary image.
image2.png -- this is identical to image1.png except that we have a person in the middle of the image.
(the person is the only difference between the two images)
What I want to do is to create another image file with just the person from image2.png and nothing else.
The thing I want to do sounds straight forward and seems like there must be a way to do it using the ImageMagick tools, but I just don't know how.
I started with the compare.exe, it seems natural to me that this program should tell the differences and allow me to save the differences (in it's original color).
I've tried "compare":
compare.exe image1.png image2.png -compose Src person.png
And it shows the differences between the two images, I can see the person's outline (in red, the rest in white), however this is not what I want.
What I want is the person in it's full original color, not just a single color from the compare.
I've experimented with convert and composite but without success.
I also thought of using the output from the compare as a "mask" and then try to "crop" just the red (the person) portion
from image2.png, but I don't know how to do that either.
compare.exe maybe not be the right tool, but I would like to know which tool and how to "diff" out just the person, in it's FULL original color.
Can someone please tell me how to do it ?
Thanks!
Update: the summary to this topic is below. Scroll down to read it or click here: viewtopic.php?f=1&t=15584#p55309
I have two images:
image1.png -- this image is a photo, and is a scenary image.
image2.png -- this is identical to image1.png except that we have a person in the middle of the image.
(the person is the only difference between the two images)
What I want to do is to create another image file with just the person from image2.png and nothing else.
The thing I want to do sounds straight forward and seems like there must be a way to do it using the ImageMagick tools, but I just don't know how.
I started with the compare.exe, it seems natural to me that this program should tell the differences and allow me to save the differences (in it's original color).
I've tried "compare":
compare.exe image1.png image2.png -compose Src person.png
And it shows the differences between the two images, I can see the person's outline (in red, the rest in white), however this is not what I want.
What I want is the person in it's full original color, not just a single color from the compare.
I've experimented with convert and composite but without success.
I also thought of using the output from the compare as a "mask" and then try to "crop" just the red (the person) portion
from image2.png, but I don't know how to do that either.
compare.exe maybe not be the right tool, but I would like to know which tool and how to "diff" out just the person, in it's FULL original color.
Can someone please tell me how to do it ?
Thanks!
Update: the summary to this topic is below. Scroll down to read it or click here: viewtopic.php?f=1&t=15584#p55309