convert is ignoring my compression options

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
snovotill

convert is ignoring my compression options

Post 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?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: convert is ignoring my compression options

Post 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
snovotill

Re: convert is ignoring my compression options

Post 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.
Post Reply