0

As an example if I upload an image to imgur twice and once on another website there's a fair chance that all 3 images will have different checksums. jpeg is lossy so I can't simply check if the pixels match.

How do I check if have the same picture encoded different? I don't want to write an algorithm, I want to use a library or offline app via CLI

Additional information: I prefer it to be considered different pictures if it's cropped differently but for my use case it won't matter (and I can simply check the width and height if I want that?)

Eric Stotch
  • 4
  • 2
  • 15
  • I'm sure there are many possible answers to this, one example: 2x2 blur to get rid of at least some of the artifacts, compute difference of the two images, take average from all pixels, if it's below (5,5,5) the two images were probably the same? –  Oct 31 '20 at 19:34
  • A good discussion is here: https://stackoverflow.com/questions/843972/image-comparison-fast-algorithm –  Oct 31 '20 at 19:35
  • The question seems to be too general - there is no clear definition when two images are considered to be the same image, and when the images are too different and considered to be two different images. You may compute the MSE - [Mean squared error](https://en.wikipedia.org/wiki/Mean_squared_error), and define some threshold, when below it, the images are the same. Other similarity measurements are [PSNR](https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio) and [SSIM](https://en.wikipedia.org/wiki/Structural_similarity). I suggest you to edit your question and make it more focused. – Rotem Jun 05 '22 at 08:34

0 Answers0