I have many product images on my local drive that I got from different sources and some of them are messed up a bit. I'm talking about images that are large in resolution but it is apparent that this resolution has been achieved by resizing the image from a very small source.
Is there a software or something that could find these usualy high-res but low quality images? Thanks for any ideas.
I have a few ideas, and I'll show what I am getting at with ImageMagick which is installed on most Linux distros and is available (for free) for macOS and Windows.
Just to clarify what I am talking about, it is the lack of high-frequency information (detail) in images when they upsized (up-rezzed) from smaller images. Here is an example:
The technique goes like this. Take an image, copy it, scale it down to a percentage of its original size and then scale it back up and measure how much it differs from the original. Here is an example:
If I now do that in a loop, I can get the MSE ("Mean Squared Error") for resizing an image down to 10% and back up, down to 20% and back up, down to 30% and back up like this:
Sample Output
If you run that again, but redirect the output to a file called
"data"
, you can plot it withgnuplot
:Now, we come to the actual point. If I run the plot for a file that was up-rezzed from 75% of its original size, then again for a file that was up-rezzed from 50% of its original size, and again for 25% and 15%, I can put them together in an animation like this:
Hopefully, you can see that the purple points depart from the x-axis (where the MSE error is low) immediately at the point corresponding to the percentage of the original size from which the image was up-rezzed.
So, I am suggesting that you look at your images and find a threshold for the error that would correspond to the degree of up-rezzing likely to be present and then test the error for any individual image against that threshold.
This would be just the same if you are on Windows, all the code above is only for generating the plots and numbers to make animations. You just need to get the MSE with one line: