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?".
I try to find some standards I can use to clean scanned text documents in linux is there a standard command i can use with imagemagick in a script that will do part of the work?
There is no need to loop over each image with mogrify. Its purpose is to process all files in the directory. If you want to loop, then use convert rather than mogrify.
Also -normalize and -level should not be needed together. You should be able to set argument to -contrast-stretch to achieve the same result. But you will have to play with the arguments. I suspect that code and suggestion was designed for a specific kind of document being scanned. It may not be general enough or apply to your scan.
If you post and example scan (upload to some free hosting service that won't change the image and does not require a password and put the URL here), perhaps we can suggest a better approach to cleaning it. Since you are on a Unix-like system, you might want to look at my script, textcleaner, at my link below.
- I scan many different documents in black white (gray) it can be receipts or payslips or other documents therefore I want an imagemagick command that is universal but it may not be possible? - If I have to change the command constantly according to the document, it takes a long time: / - An example could be this document:
With PDF files that have images imbedded, you perhaps should extract the image from the PDF. Otherwise try rasterizing with a large density value. But that example looks pretty clean to me. With your PNG file, it has noise in it. You could try some noise removal such as -enhance or -morphology. For example