Skip to content

Instantly share code, notes, and snippets.

@valyakuttan
Last active September 28, 2025 06:18
Show Gist options
  • Select an option

  • Save valyakuttan/20431aea7228fc9810ffcb8c234cea7c to your computer and use it in GitHub Desktop.

Select an option

Save valyakuttan/20431aea7228fc9810ffcb8c234cea7c to your computer and use it in GitHub Desktop.

Useful jgg and pdf Tricks Using Linux CLI Tools

  1. How to Reduce File Size of Images by Reducing Quality

         $ convert <INPUT_FILE> -quality 10% <OUTPUT_FILE>
  2. How to Reduce File Size of Images in Linux by Reducing Resolution

         $ convert <INPUT_FILE> -resize 200x200 <OUTPUT_FILE>
  3. How to Merge Multiple PDF Files into One PDF

         $ pdfunite in-1.pdf in-2.pdf in-n.pdf out.pdf
  4. How to Reduce the File Size of a Scanned PDF File

         $ gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook \
              -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment