Get absolute color difference between two imags.

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
coolperez8
Posts: 27
Joined: 2016-03-11T07:27:11-07:00
Authentication code: 1151

Get absolute color difference between two imags.

Post by coolperez8 »

So, let's say I have 2 images. Both are identical, except one has a semi-transparent overlay placed over it. What I want to do is convert both images to greyscale, and render an output image which has values that are the absolute difference between the two input images. Also, How can I extract a semi-transparent overlay from an image, assuming it has the same opacity?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Get absolute color difference between two imags.

Post by snibgo »

coolperez8 wrote:What I want to do is convert both images to greyscale, and render an output image which has values that are the absolute difference between the two input images.

Code: Select all

code in1.png in2.png -colorspace Gray -compose Difference -composite out.png
coolperez8 wrote:Also, How can I extract a semi-transparent overlay from an image, assuming it has the same opacity?
I think of this as a de-watermarking problem. See Watermarks.
snibgo's IM pages: im.snibgo.com
coolperez8
Posts: 27
Joined: 2016-03-11T07:27:11-07:00
Authentication code: 1151

Re: Get absolute color difference between two imags.

Post by coolperez8 »

snibgo wrote: 2017-07-09T13:35:29-07:00
coolperez8 wrote:What I want to do is convert both images to greyscale, and render an output image which has values that are the absolute difference between the two input images.

Code: Select all

code in1.png in2.png -colorspace Gray -compose Difference -composite out.png
coolperez8 wrote:Also, How can I extract a semi-transparent overlay from an image, assuming it has the same opacity?
I think of this as a de-watermarking problem. See Watermarks.
How would I use the scripts? I have a Windows 10 PC as well as a PC running Linux Mint 18.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Get absolute color difference between two imags.

Post by snibgo »

The scripts and commands are Windows BAT syntax. Example commands on the page show commands that use the script. They are simple, and could easily be converted to bash or any script language.
snibgo's IM pages: im.snibgo.com
Post Reply