Page 1 of 1

convert pdf to monochrome png results in mostly black document

Posted: 2017-09-18T05:34:35-07:00
by warpno
Hi all,

trying to convert a pdlatex generated two-pages pdf form (white background, black text, headers with grey background) into a monochrome png always results in the first png (i.e. corresponding to the first page of the pdf) being almost completely black. This happens regardless of what threshold value I set, e.g.:

Code: Select all

convert test.pdf -monochrome -threshold 50% test.png
Thanks for any help

Re: convert pdf to monochrome png results in mostly black document

Posted: 2017-09-18T05:59:15-07:00
by snibgo
After "-monochrome", the image contains black and white only, so "-threshold" has no effect. If you want to threshold at a certain level, just do that, without "-monochrome" (or reverse the order: threshold first, then monochrome).

Re: convert pdf to monochrome png results in mostly black document

Posted: 2017-09-18T06:05:35-07:00
by warpno
Thank you very much snibgo,

now I have another problem: I need a real monochrome tiff but when I do identify I get:

Code: Select all

TIFF 595x842 595x842+0+0 8-bit Grayscale Gray 15426B 0.000u 0:00.000
shouldn't it be: "Gray 2c"??

Re: convert pdf to monochrome png results in mostly black document

Posted: 2017-09-18T06:42:44-07:00
by snibgo
Sorry, I don't know what "a real monochrome tiff" is. Perhaps one of the "-type" options gives you that, eg "-type palette".

IM tools don't tell you how the image is stored in the file. If you want to know that, use exiftool.

Re: convert pdf to monochrome png results in mostly black document

Posted: 2017-09-18T06:44:10-07:00
by warpno
I solved it.
For some reason I had to set:

Code: Select all

-compress Group4