I've got a bunch of PNG images, and I'm looking for a way to identify duplicates. By duplicates I mean, specifically, two PNG files whose uncompressed image data are identical, not necessarily whose files are identical. This means I can't do something simple like compare CRC hash values.
I figure this can actually be done reliably since PNGs use lossless compression, but I'm worried about speed. I know I can winnow things down a little by testing for equal dimensions first, but when it comes time to actually compare the images against each other, is there any way to do it reasonably efficiently? (ie. faster than the "double-for-loop checking pixel values against each other" brute-force method?)
Compare Brightness as half the weight and compare color/hue as the other half (or 2/3rds vs 1/3rd). Calculate the difference in values and depending on 'tolerance' value they are the same or they are not. JPEG heavily compresses the color information but tries not to ruin the liminance values. Save this answer.
The general idea is very simple - pixel-by-pixel comparison. The comparison engine gets the color of pixels that have the same coordinates within the image and compares this color. If the color of each pixel of both images coincides, TestComplete considers the two images to be identical.
English: This is a temporary file for testing of correct rendering of PNG files. This file can be modify by anyone, to test their own PNG. If you suspect a problem with the rendering of your graphic, then upload it the first time here (it's easier than delete an upload).
store hash
compare hashes to find identical ones
Instead of looping through all pixels in order to check equality, it might be worth while starting from the middle and working your way outwards. Most pictures have the subject in the middle meaning more feature data is located here. Essentially it will be lots quicker to find out if two pictures are different this way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With