Unpaper or its underlying libraries don't seem to accept pnms with an
odd integer width. Although it's not clear if this is the issue at all.
In any case, keeping the image a PNG works around the issue. unpaper
only accepted PNM input in the past, which is why we send it PNM.
Since it now accepts PNG, we might as well use PNG.
Unpaper can write PNG as output too, but this added a few seconds to
the test suite was not committed.
Related issues:
https://github.com/ocrmypdf/OCRmyPDF/issues/887https://github.com/ocrmypdf/OCRmyPDF/issues/665https://github.com/unpaper/unpaper/issues/82
While faster than Python based methods, we've outgrown the limited
amount of information Ghostscript provides with this feature, and it
repeats an analysis we have to do anyway to learn what images are
present.