blag: opmizing PDFs: add `-compress jpeg` note from Marcus
authorRoland Hieber <rohieb@rohieb.name>
Fri, 9 Jun 2023 08:09:42 +0000 (10:09 +0200)
committerRoland Hieber <rohieb@rohieb.name>
Fri, 9 Jun 2023 08:09:42 +0000 (10:09 +0200)
blag/post/optimizing-xsane-s-scanned-pdfs.mdwn

index ccf9b42..5169a60 100644 (file)
@@ -344,6 +344,17 @@ offset if the image ratio is not quite exact:
 With that approach, I could reduce the size of my PDF from 250&nbsp;MB with
 losslessly compressed images to 38&nbsp;MB with DCT compression.
 
+*Another update (2023):* Marcus notified me that it is possible to use
+ImageMagick's `-compress jpeg` option, this way we can leave out the
+intermediate step and convert PNM to PDF directly:
+
+    $ convert image*.pnm -compress jpeg -quality 85 output.pdf
+
+You can also play around with the `-quality` parameter to set the JPEG
+compression level (100% makes almost pristine, but huge images; 1% makes very
+small, very blocky images), 85% should still be readable for most documents
+in that resolution.
+
 Too long, didn’t read
 -----------------
 
This page took 0.027099 seconds and 4 git commands to generate.