leptonica: dot matrix improvement scripts
Work around Leptonica's buggy PNM/PPM/etc reader

If the first pixel of the image looks like whitespace, it may get
consumed by Leptonica's PNM parser, due to a Leptonica bug in their
use of fread().  To work around this, transparently convert to another
format.  Reading with PIL and dumping to a PIX object would be more
efficient but also harder to implement.

Error message from Leptonica is:
Error in pixReadStreamPnm: error in 5

Also might see (for a color image):
Error in pixReadStreamPnm: error in 6