I have a folder with larger number of scanned image documents - it is a mix of JPG, TIF, PNG and PDF. My task is to enhance the images and then OCR them. Some of the images are scanned with good resolution and therefore are of good quality; so these may not need enhancement using IMs 'convert' command - so can be passed straight to the OCR engine. However, there a number of images that would need enhancement. My question is as follows:

Is there an [Open Source] program or software to determine which of the images in the folder would need some level of enhancement, and then automatically apply the enhancement through IMs 'convert' command with the right set of arguments / parameters and values?

In short, am looking for a completely automated program without manual intervention.