When the input file is 600 dpi, the leftmost 25% and rightmost 25% of the content is truncated. Only the middle 50% survives unpaper. My command was simply: $ unpaper -t pbm source.pgm target.pbm I also tried adding --dpi 600, which had no effect. This defect has already been reported upstream. This bug report is filed to indicate that version 7.0.0-0.1 of the debian pkg is affected. This is also to add information, as the original bug report demonstrates the problem with TIFF files, while my experience shows that the bug also manifests in a PGM→PBM conversion.
DPI page. Then fed that into unpaper. There was no data loss. So apparently the unpaper bug manifests when an image is more than ~2550 pixels wide.
The defect is very reproduceable when the width well exceeds 2550 pixels. However, even when an image is normal (2550 pixels wide a4, 300dpi), it sometimes still truncates ⅓ of the image. The following two images went through the same processing prior to feeding to unpaper: ===8<---------------------------------------- $ identify broken.pgm workng.pgm broken.pgm PGM 2550x3508 2550x3508+0+0 8-bit Grayscale Gray 8.53101MiB 0.030u 0:00.042 workng.pgm PGM 2550x3508 2550x3508+0+0 8-bit Grayscale Gray 8.53101MiB 0.040u 0:00.122 ===8<---------------------------------------- The images have the same geometry. Yet broken.pgm lost a chunck of content and workng.pgm had no issue. So images >2550 pixels wide are reproduceable but images at 2550 pixels wide are unpredictably broken.