Hacker News new | ask | show | jobs
by jihchi 2011 days ago
Were you comparing two identical image? Could you try two different image?
1 comments

To really see how these algorithms perform, you should compare the worst case for the algorithm. In order to see if a picture is identical, you’d have to loop through every single pixel, which is the worst case. But you can shortcut on the first pixel which is different, which I imagine happens pretty quickly on many generic pictures. So testing performance with two different images is probably not best for comparison.
You can only short-circuit if you’re returning a Boolean. If you need to do what these tools and return some metric for the degree of difference you still have to process both images in entirety.