How to find images that have been resized ?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
dragonv12

How to find images that have been resized ?

Post by dragonv12 »

I got duplicate images in different size, I would like to find the images that have been down or uppersampled. When you open the image and check yourself by zooming you can easily tell if it has been resampled or not but how to find out using imagemagick ?
thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to find images that have been resized ?

Post by fmw42 »

The only way that I can think of to do that in IM, is to

First, use -resize to resize them to the exact same size.
Then use compare -metric rmse to find out if they are within some threshold value of being the same, i.e. less than some threshold value.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to find images that have been resized ?

Post by anthony »

This is me bane of existance. However resized images should be reasonable matchable by comparing smaller thumbnails of the images (3x3 pixel thumbnail is a good way to do initial matching).

I have a huge collection of images fro mall over the web and I am trying to find matching and stolen images. Images could have been resized, cropped, borders added, and color enhanced. Finding duplicates is a nightmare.

Color enhancements make direct matching difficult without very loose matching thresholds, and crops and borders can make spatial matching of images difficult. If you also want to find rotated (not 90) duplicates, you may as well forget it!


My ImageMagick Page on Comparing Images
http://imagemagick.org/Usage/compare/
Is where I have saved some information of various techniques i have developed.

The main one at the moment is the use of a 3x3 color matrix as a image signature. This allows images to be grouped basied on general color matching, using color vectors basied on that matrix. From that general groups, THEN you can do matching on larger thumbnails (removing size) to find reasonable simular images.

If you find links or other methods for finding image duplicates, then please let me know. I am always looking for new ideas, but most are just rehashed simplistic methods.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
dragonv12

Re: How to find images that have been resized ?

Post by dragonv12 »

Oh you mean about identifying similar images ... yeah I know not easy to do that, doesn't signature help about that ?

Code: Select all

Signature: 68aafab3102b46721f182048f23f914c7e32bad3bbc54eda740b6c01c9f126e0
I wanted more to find image that have been resized so I can delete them, you know like when you have tons of pixels around edges because the antialiasing pixels have been antialiased themself during the resize... :)
dragonv12

Re: How to find images that have been resized ?

Post by dragonv12 »

anthony wrote:This is me bane of existance. However resized images should be reasonable matchable by comparing smaller thumbnails of the images (3x3 pixel thumbnail is a good way to do initial matching).

I have a huge collection of images fro mall over the web and I am trying to find matching and stolen images. Images could have been resized, cropped, borders added, and color enhanced. Finding duplicates is a nightmare.

Color enhancements make direct matching difficult without very loose matching thresholds, and crops and borders can make spatial matching of images difficult. If you also want to find rotated (not 90) duplicates, you may as well forget it!


My ImageMagick Page on Comparing Images
http://imagemagick.org/Usage/compare/
Is where I have saved some information of various techniques i have developed.

The main one at the moment is the use of a 3x3 color matrix as a image signature. This allows images to be grouped basied on general color matching, using color vectors basied on that matrix. From that general groups, THEN you can do matching on larger thumbnails (removing size) to find reasonable simular images.

If you find links or other methods for finding image duplicates, then please let me know. I am always looking for new ideas, but most are just rehashed simplistic methods.
I have looked at your page and it is impressing of technical usefull informations :) I've bookmarked it and I'll sure get back to it soon.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to find images that have been resized ?

Post by anthony »

dragonv12 wrote:Oh you mean about identifying similar images ... yeah I know not easy to do that, doesn't signature help about that ?

Code: Select all

Signature: 68aafab3102b46721f182048f23f914c7e32bad3bbc54eda740b6c01c9f126e0
I wanted more to find image that have been resized so I can delete them, you know like when you have tons of pixels around edges because the antialiasing pixels have been antialiased themself during the resize... :)
A signature only works if the image has NOT been modified, or even read/write. It only works for exact file copys!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply