Page 1 of 1

[6.7.7] "monochrome" switch not working

Posted: 2012-06-03T16:04:38-07:00
by qwpa
Up until 6.7.6 I always used the following command to convert a .PDF file to monochrome .TIFF files :

Code: Select all

convert -antialias -monochrome -density 300x300 -units pixelsperinch test.pdf test-%04d.tiff
But in 6.7.7 the command no longer works: it produces RGB .TIFF files instead of monochrome .TIFF files. I believe it's a bug.

Code: Select all

convert --version
Version: ImageMagick 6.7.7-2 2012-06-03 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features:  OpenCL   

Re: [6.7.7] "monochrome" switch not working

Posted: 2012-06-03T18:22:42-07:00
by fmw42
You syntax is not really correct for IM 6 (-monochrome should be after the pdf), but that should not really matter. I don't think -antialias is meaningful in this usage, I think it is only for drawing text. But it should not hurt to have it.

But in IM 6.7.7.6 beta on Mac OSX Tiger, I do not have any trouble with doing the following:

# create pdf
convert logo: logo.pdf

# process pdf to tiff using -monochrome
convert -density 300x300 -units pixelsperinch logo.pdf -monochrome logo2.tiff

The result is binary. Note that -monochrome will produce dither pattern.

see
http://www.imagemagick.org/Usage/basics/#cmdline
http://www.imagemagick.org/script/comma ... #antialias
http://www.imagemagick.org/Usage/quantize/#monochrome

Perhaps you should either provide your pdf image or upgrade to a later version of IM.

Re: [6.7.7] "monochrome" switch not working

Posted: 2012-06-03T18:55:44-07:00
by qwpa
I think that my problem is the same one described here : viewtopic.php?f=3&t=21119

Apparently 6.7.7-2 has a bug involving monochrome TIFF images, and the bug was solved in 6.7.7-4 (or at least that's what I understood -- I might be wrong). I am building from the MacPorts version (because I am not savvy enough to build manually) and unfortunately they don't have anything newer than 6.7.7-2. For now, I downgraded to 6.7.6-9, which works without problems.

Anyway, thank you for your comments about the switches.

Re: [6.7.7] "monochrome" switch not working

Posted: 2012-06-03T20:05:58-07:00
by anthony
fmw42 wrote:You syntax is not really correct for IM 6 (-monochrome should be after the pdf
Actually from my recent studies in preparation for IMv7 changes, I learned that in one case monochrome was being used as a setting, and not as a pure operator it should be. In PDF reading.

This I thought was silly and really should be removed as a setting, or replaced with the appropriate '-type' setting.


In any case Fred is right. Monocrome should be after the PDF, and is essentially a 'dither with black and white colors only'. In a quantization sense... a dithered 'threshold'.