Page 1 of 1

ImageMagick: Re-compressing images in PDF

Posted: Wed Nov 16, 2016 8:18 pm
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: