Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use ImageMagick to substract a image from another?

I have this two images :

First
(source: free.fr)

Second
(source: free.fr)

How can I use imagemagick to remove the background (second picture) from the first one ?

Cheers,

Rémy

Here I made you a final but simple example :

Transparent Overlay http://noosphere.ionyse.com/transparent_example/transparent_difference.png Background http://noosphere.ionyse.com/transparent_example/background.png

Example 1 http://noosphere.ionyse.com/transparent_example/background-example.png Example 2 http://noosphere.ionyse.com/transparent_example/background-example2.png

Here you see that anywhere I put the transparent overlay on the background I get the perfect match using the opacity of the overlay PNG.

I would like to be able to calculate this overlay image. Do you think it is possible using ImageMagick ?

like image 425
Natim Avatar asked Jan 24 '11 13:01

Natim


1 Answers

This is explained over here How to save the DIFFERENCES between two images ?.

Another useful link: http://www.imagemagick.org/Usage/compare/#difference

like image 170
aioobe Avatar answered Oct 10 '22 07:10

aioobe