How to specify two compress methods for one pdf

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
Jarek
Posts: 1
Joined: 2011-03-25T11:44:05-07:00
Authentication code: 8675308

How to specify two compress methods for one pdf

Post by Jarek »

There's a topic How do I minimize IM's PDF output size? which explains how to use different compression algorithms to achieve the smallest pdf size. But when I convert a gif image together with a jpeg image I'm stuck. Whatever method I choose I get an enormous size of the pdf file.

Each of the 2 source images compresses perfectly when thrown to a separate pdf. So I would like to insert them into 1 pdf using 2 different compression algorithms. My command line could look:

Code: Select all

convert -compress jpeg skan0007.jpg -compress lzw strona.gif out.pdf
Am I able to get this effect? Now? In future?

My jpeg image is high resolution colored image, and the gif is of type lineart. So the first must be jpeg and the second must be gif. Converting jpeg to gif or gif to jpeg creates unacceptably big files.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to specify two compress methods for one pdf

Post by anthony »

No gurrantees but try...

convert \( skan0007.jpg -compress jpeg \) \( strona.gif -compress lzw \) out.pdf

It may work, it may not. Depends on how IM is handling the -compress setting.

You could also try -set compress but that is much less likely.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply