With -mono and some resolutions, pdftoppm's behavior is not reproducible
For me, it seems that this occurs for resolutions larger than 300. The following code can be used to exemplify the problem.
The pbm files generated are different but, more importantly, if one looks at them (I used geeqie) with a high enough zoom, one can see the the pixels are indeed different.
I have observed the problem with:
pdftoppm version 21.01.0 Copyright 2005-2021 The Poppler Developers - http://poppler.freedesktop.org Copyright 1996-2011 Glyph & Cog, LLC
Linux frac 5.17.12-100.fc34.x86_64 #1 SMP PREEMPT Mon May 30 17:47:02 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
as well as with:
pdftoppm version 22.02.0 Copyright 2005-2022 The Poppler Developers - http://poppler.freedesktop.org Copyright 1996-2011 Glyph & Cog, LLC
Linux loreen-tablet 5.19.0-43-generic #44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon May 22 13:39:36 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
#!/bin/bash
pdf_file=$1
for c in ' ' '-mono' '-gray'; do
for r in 150 300 600 1200; do
echo $c $r;
for i in `seq -w 1 20`; do
pdftoppm -singlefile $c -r $r ${pdf_file} $i
diff -q $i.p?m 01.p?m
done
echo " "
\rm ??.p?m
done
done