ImageMagick: Re-compressing images in PDF

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
peter_b
Chatterbox
Posts: 371
Joined: Tue Nov 12, 2013 2:05 am

ImageMagick: Re-compressing images in PDF

Post by peter_b »

I've recently received PDF files solely as access copy for reviewing some textual content, but they had too many images in way too high resolution in them.
This caused these PDFs to become almost unreadable even on a modern computer.

Here's how you "resize" (actually re-compress) a PDF to PDF with ImageMagick:

Code: Select all

$ convert -density 300x300 -quality 80 -compress  jpeg input.pdf output.pdf
Options:
  • density: This is the target resolution for images (in DPI) for width/height.
  • quality: For JPEG it's 1-100, where 100 is best quality (=largest file). For other compression formats see ImageMagic documentation: "-quality".
Links:
Post Reply