Languages
[Edit]
EN

Java - find differences on two images (absolute difference)

5 points
Created by:
Suzannah-Estrada
620

In this short article, we would like to show how to find differences on two images using Java.

To find differences on two images it is good to use absolute subtraction on two images. Let's suppose we have 2 images: A and B. The result image (C image) may be calculated using fomula: |B - A| = C.

Operation visualization:

Calculated absolute subtraction on two images using Java.
Calculated absolute subtraction on two images using Java.

Result interpretation:

Black colors mean: pixels do not have difference. White colors mean: pixels are totally different. Middle colors mean: there is some difference (smaller in direction to black, bigger in direction to white).

Note: to reverse colors (from white to black) we can use fomula: 255 - |B - A| = C what was presented in this article.

 

Practical example:

 

Used resources

Edit

a.png file:

a.png file.

b.png file:

b.png file.

 

See also

Edit
  1. Java - find differences on two images (inverted absolute difference)

Alternative titles

  1. Java - subtract two images (absolute subtraction)
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join