Hello. There are two bitmap differences between them are minimal, no more than 1 - 2% of the number of all points. Is it possible to find differences other than complete enumeration of all points in these two bitmap?

  • This is certainly not java, but ... imagemagick.org/script/compare.php And, of course, imagemagick sorts through all the pixels. - alexlz
  • one
    And how can you find all the different pixels without reading their values? This is evidence that "sorting using only comparison operations cannot work faster than in n * log n". You can make sure with some probability that they are the same. Or if there are a lot of pictures ... - Mikhail M
  • 2
    disassemble the image in pieces. Compare the hashes of the pieces. If diverge - read pixels. - lampa

1 answer 1

And what does it mean "differences" that you want to find? Just mark the pixels that are different? If yes, then nothing can be done, you still have to go through all the pixels.

Comparing hashes, and then pixels, in the worst case, we will get 2 passes for each pixel. It's easier then to go for a run and compare pixels in 1 pass XOR or in general the whole picture.

  • How is 2 passes? And just a pack of bytes does not compare? - lampa
  • "Compare hash pieces" - the first pass. "If they diverge, we compare the pixels." - second pass. I propose "just a pack of bytes compare XOR" - Andrew Frolov
  • @AndrewFrolov did not catch this thought in response. Now it is clear. - lampa