Page 1 of 1

convert is ignoring my compression options

Posted: 2008-10-11T16:19:49-07:00
by snovotill
I'm trying to get "convert" to respect my compression directive when making pdf.
For optimum PDF size with line drawings, one MUST use Group4 fax compression.
For optimum PDF size with halftones, one MUST use Zip aka Deflate compression.

convert -compress Group4 -quality 100 -units PixelsPerInch -density 600 diagram.tif diagram.pdf
convert -compress Zip -quality 100 -units PixelsPerInch -density 600 halftone.png halftone.pdf
Version: ImageMagick 6.2.4 02/10/07 Q16 http://www.imagemagick.org

When I give the above commands, I get HUGE pdf files, orders of magnitude bigger than expected.
When I execute identify -verbose filename.pdf, I can see that the compression is "Unknown"

Very strange, Any ideas? Is there a way to just stuff a pre-compressed tif or png into a pdf
without recompressing it?

Re: convert is ignoring my compression options

Posted: 2008-10-11T16:59:50-07:00
by magick
The image must be monochrome before it can be saved with Group4 compression. We're using ImageMagick 6.4.4-4 and this command works as expected:
  • convert diagram.tif -monochrome -compress Group4 -quality 100 -units PixelsPerInch -density 600 diagram.pdf
Zip compression requires that zlib be associated with the DELEGATES tag. Type
  • convert -list configure
to confirm. We're using ImageMagick 6.4.4-4 and this command works as expected:
  • convert diagram.tif -compress zip -quality 100 -units PixelsPerInch -density 600 diagram.pdf

Re: convert is ignoring my compression options

Posted: 2008-10-12T01:59:59-07:00
by snovotill
Yikes, it took me hours to get a newer imagemagick installed, but that fixes a FRIGHTENING number of bugs!
I was able to eliminate pdftk, libtiff-tools, and gs-gpl from my bash scripts WOOHOO!!!! Thanks.