On 2026-11-16, Rich <ri…@example.invalid> wrote:
> Charlie Gibbs <cgib…@kltpzyxm.invalid> wrote:
>
>> Indeed. Thanks for the help. Unfortunately, my tests have suddenly
>> stopped working - pgmtopbm has seemingly started ignoring my threshold
>> setting. Stripping down the commands to work on a single-page PDF:
>>
>> $ gs -dNOPAUSE -q -r300 -sDEVICE=pgmraw -dBATCH -sOutputFile=testfile3.pgm testfile.pdf
>> $ pgmtopbm -threshold -value 0.82 testfile3.pgm >testfile3.pnm
>> $ pnmtotiff -g4 <testfile3.pnm >testfile3.tif
>>
>> Is there something wrong with my pgmtopbm command?
>
> Not that I see from the above example, other than the result file
> should be named ".pbm" as it is a Portable Bit Map (monochrome) file.
> But so long as you use the same name to feed into pnmtotiff it won't
> matter a bit what you name it.
>
>> If I remove the "-threshold -value 0.82" parameters
>> the output (testfile3.pnm) is exactly the same.
>
> Weird. I would expect some change, as it is supposed to be outputting
> pbm, and you should be sending in greyscale, so the two files should
> differ.
It's frustrating that I got it to work once. I tried purging and
re-installing the netpbm package in case something got corrupted,
but it made no difference. If I give a bogus threshold value
(e.g. 2) pgmtopbm issues an error message. I also tried moving
the -threshold -value parameter ahead of the input file name,
but that made no difference. I tried arranging the command-line
parameters in many different orders, e.g.
$ pgmtopbm >testfile3.pbm testfile3.pgm -value 0.82 -threshold
The result still came out the same. However, leaving out "-threshold":
$ pgmtopbm testfile3.pgm -value 0.82 >testfile3.pbm
gave a page with a light gray backround rather than a white one.
That's the only way I've managed to get the output to change.
Curiouser and curiouser...
--
/~\ Charlie Gibbs | In this world there are
\ / <cgib…@kltpzyxm.invalid> | two kinds of people:
X I'm really at ac.dekanfrus | 1. Those who can extrapolate
/ \ if you read it the right way. | from incomplete data.