Learning more about convert from ImageMagick

As I often scan documents that in the end I want to get in Black & White and cropped, I decided to look at the capabilities of the convert command line tool so I wouldn't have to manually change those images.

With the Gimp I can load the image, crop it to only what I want to keep, then convert the page to black and white. However, to get a valid black and white image, you want to first apply a filter that looks like this:

Filter to prepare image for monochrome conversion.

This is done using the following convert command line option:

-level 55%,71%,1.0

This tells the convert tool to change all colors that have a level of 55% or less to zero (black) and any color that have a level of 71% or more to one (white). Anything else is left alone.

Without that step, we get many artifacts like in the following word:

San Francisco -- Black and White without filtering
(click to better see the dots)

You may think that isn't much to worry about. Maybe you're right as in... maybe your fax system will work right with such images. I tried with two different systems, and letters with too many small dots appear really dark / black on the destination fax machine. So... if i want to fax such documents, I've got to apply the level and there is the result:

San Francisco -- after applying the filter

Now that last entry looks perfect on the destination fax machine.

So the resulting command line with all the processing looks like this:

convert source.png
    -crop 5078x6578+0+0
    -level 53%,71%,1.0

These specific crop dimensions are for an image scanned at 600 DPI on my old Epson scanner.