Jump to content
MikeA

Publisher 1.8.3 (Windows) -- PDF output: unexpected results of JPEG compression

Recommended Posts

In making a book of photographs to be printed by a print-on-demand company, I found I'd exceeded their 300 MB per PDF limit even before I had all image files placed in the Publisher document. The idea of further JPEG compression was not appealing but I decided (holding my nose the entire time) to try compression settings during export to PDF. The results surprised me.

No compression: 388.5 MB
No compression (2nd time around): 363.4 MB (why the difference?)
Compression setting 100: 211 MB
Compression setting 99: 182.7 MB

Compression setting 97: 139 MB
Compression setting 95: 114 MB
Compression setting 90: 83 MB

I take it this means that the max quality setting (100) still involves re-compression of the images. All along I'd thought 100 means: no compression. Apparently not. So if output file sizes are plaguing you, perhaps the slight JPEG compression will be helpful.

Before starting the tests I ran the original JPEGs through the compression program JPEG-Mini. It made a whopping difference in the files' sizes and without noticeable loss of quality. But using the JPEGs compressed with JPEG-Mini as source files within the Publisher document doesn't seem to have provided a lot of savings during export to PDF. Perhaps JPEG-Mini's major advantage is a "web thing" and not a "print thing".

 


Affinity Publisher and Photo 1.8.3 (Windows). Lenovo laptop with decidedly sub-optimal monitor. At least it works.
“The wonderful thing about standards is that you can have as many of ’em as you want.”
– Anonymous cynic

Share this post


Link to post
Share on other sites

I did a quick comparison using original JPG photos, the same photos compress with MiniJPEG Pro, and then exporting one page (three photos) of either version from Affinity Publisher and InDesign as PDF/X-4 format, which keeps the photos in RGB format, and accordingly at least in theory would allow passing through the MniniJPEG compressed images as they are, and gain some size benefits. The ideal method, then, would be also downsampling the photos first optimized at their placed ppi resolutions (which could be as low as around 250 ppi with good-quality original photos) without compressions, and compressing only after that. But I compared here only non-downsampled images (the placed ppi value all three images being 471, so too much, but not anything excessive).

Here are the results:

 compression_comparison.jpg.3b447051fd65b33427dae5050278e922.jpg

Here are description of producted PDFs:

01 and 02: exporting in PDF/X-4 format one page consisting of three photos (the "non_mini" JPG photos) not allowing compression nor downsampling
One might assume that this kind of setting would simply just pass through the original photos but clearly this does not happen. Images are reprocessed and saved without compression or downsampling even if RGB format is retained. [EDIT: This is of course the correct behavior when using standard export, as passing through would mean allowing passing through unmanaged compression algorithms which cannot be allowed in print production, and not at least in PDF/X based production.]

03 and 04 : exporting in PDF/X-4 format one page consisting of three photos (the "mini" JPG photos) not allowing compression nor downsampling
This further confirms that images are not passed through. So it seems there is simply no point in using JPEG-mini to produce images for print purposes. 

05 and 06: exporting in PDF/X-4 format one page consisting of three photos (the "non_mini" JPG photos) using the app's default downsampling and compression settings (ID: "Maximum", APub: 98)
As can be seen, InDesign produces significantly smaller files.

07 and 08: exporting in PDF/X-4 format one page consisting of three photos (the "mini" JPG photos) using the app's default downsampling and compression settings (ID: "Maximum", APub: 98)
As can be seen, only marginal differences compared to using non-miniJPEG versions of photos.

But as can be seen from the file sizes of JPG files above, there are significant benefits for web usage.

Share this post


Link to post
Share on other sites

I appreciate your taking the time to do all that. I made a note of most of the file sizes I obtained after doing some more of this (compatibility setting for all exports from Publisher: PDF 1.4):

Files marked "[C]" were done with JPEG-Mini Pro compressed source files.
Those marked "[F]" were not compressed via JPEG-Mini.
The numbers within the filenames indicate compression level in Publisher export dialog.
 
[F] 4/25/2020  19:36     387,526,265  Boise2018-NOCOMP.pdf
[C] 4/25/2020  15:35     388,483,998  Boise2018_JPEG-NOcompr.pdf
(unexpected result; export with uncompressed JPEGs is smaller, somehow)

[F] 4/25/2020  19:39     244,546,273  Boise2018-Compr100.pdf
[C] 4/25/2020  16:28     210,858,408  Boise2018_JPEGcompr-100.pdf

[F] 4/25/2020  19:43     210,600,433  Boise2018-Compr99.pdf
[C] 4/25/2020  16:23     182,725,987  Boise2018_JPEGcompr-99.pdf

[F] 4/25/2020  19:46     173,309,855  Boise2018-Compr98.pdf

With source files compressed with JPEG-Mini and a PDF compression setting of 90,
the PDF's size dropped to ~83 MB.

Switching for a couple of tests to PDF/X-1a:2003 produced crazy-large files and I gave up on that idea quick-like.

In another discussion about this, someone mentioned using Acrobat to optimize his PDFs' sizes. That's an expensive solution for someone like me who isn't in the trade. Perhaps there's other software specialized for that purpose and without all of Acrobat's bells and whistles. Then again those kinds of tools might produce optimized files that aren't suitable for press.


Affinity Publisher and Photo 1.8.3 (Windows). Lenovo laptop with decidedly sub-optimal monitor. At least it works.
“The wonderful thing about standards is that you can have as many of ’em as you want.”
– Anonymous cynic

Share this post


Link to post
Share on other sites

I would be very careful in using optimizing with print pdfs (especially PDF/X based exports), especially if the exporting app already supports well-working compression with a compression quality setting, and downsampling trigger. as there is a danger that something goes wrong when tampering the file.

That said, I tested optimizing witht the above mentioned PDF/X-4 files, the original sizes of which were 26MB (ID) and 19MB  (APub) using PDF-Tools optimizer with a setting that downsamples images above 300ppi at 254ppi, and got the following results (marked with the word (optimized) appended to filename):

compression_comparison2.jpg.4c313072b94cfcd7ba9fbd36c709b1ac.jpg

So quite remarkable compression -- I have no clue why Affinity Publisher created PDF did not compress as much. But I'd still use the page layout app's own settings to produce the print files, and not touch them after that. I did run Acrobat PDF/X-4 complience verifier routines against the optimized files, and they passed without warnings. The colors of CMYK objects were also retained so it seems nothing else was done than compressing the images.

Here is a comparison of quality difference (original left and optimized right, at 300% zoom level):

 original_uncompressed.jpg.ec7f24aaec6bb37ef3e626b58a1377fb.jpg original_oprimized_by_pdf-tools.jpg.f61a8a2762cbe76c9942734e4967fa49.jpg

PDF-Tools is a EUR60 utility by Tracker Software for WIndows only, and I notice that I am now again adverizing it here -- I'm really not affiliated in any way, but I've just noticed that it is a robust and versatile tool and a good addition to Affinity apps (if you do not already own Adobe Acrobat or similar app). 

Share this post


Link to post
Share on other sites

Thanks for the further information. If optimization could foul up the print job, I'll live without it. I just now uploaded the PDF to the on-demand book company and while it wasn't lightning-fast, it didn't give me fits. The export settings I used — PDF 1.4, downsampling on, JPEG compression=99 — produced a file just under the maximum allowed (300 MB). If I'd used the JPEG-mini files I could probably have added a few more images and used quality=100. But this is good enough for now. Well, assuming the book doesn't look like dog-meat-on-a-stick when they're done with it. : ) It's been a long haul learning Publisher from the ground up and acquainting myself with font-related tools I haven't had to think about for years. Thanks a lot for your advice along the way—it was extremely helpful.


Affinity Publisher and Photo 1.8.3 (Windows). Lenovo laptop with decidedly sub-optimal monitor. At least it works.
“The wonderful thing about standards is that you can have as many of ’em as you want.”
– Anonymous cynic

Share this post


Link to post
Share on other sites
9 hours ago, MikeA said:

I take it this means that the max quality setting (100) still involves re-compression of the images. All along I'd thought 100 means: no compression. Apparently not.

Yes, even at the maximum "quality" setting the standard JPEG discrete cosine transform (DCT) encoder uses a form of lossy compression.


Affinity Photo 1.8.3, Affinity Designer 1.8.3, Affinity Publisher 1.8.3; macOS Mojave 10.14.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 
1.8.3.180 & Affinity Designer 1.8.3.2 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.3.1

Share this post


Link to post
Share on other sites
On 4/26/2020 at 12:31 AM, Lagarto said:

Here is a comparison of quality difference (original left and optimized right, at 300% zoom level):

Interesting. Depending on my OCD level for the day, I'll think either that the differences are negligible or that they're very obvious. Then again 300% is a pretty extreme enlargement.


Affinity Publisher and Photo 1.8.3 (Windows). Lenovo laptop with decidedly sub-optimal monitor. At least it works.
“The wonderful thing about standards is that you can have as many of ’em as you want.”
– Anonymous cynic

Share this post


Link to post
Share on other sites
19 hours ago, MikeA said:

Then again 300% is a pretty extreme enlargement

Yes, you typically can tell the difference, but it is kind of a general feel rather than an actual perception of differences. But the differences of course are there, as otherwise you could not get these kinds of compression rates. At 500% zoom level you can already see how the image is deteriorated. This kind of loss in detail might well affect the quality of halftoning so I guess there is a good reason to keep JPG compression rates pretty modest (and quality high).

Left: Original, right: optimized (these are the same images as above but now in PNG format so no additional compressing when uploading on the forum):

 jpg_original.png.2d13b9c6aa23495bc2f5469d4efae5e8.png jpg_optimized.png.a370de35f52a66e709b1f1174833a607.png

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Please note the Annual Company Closure section in the Terms of Use. These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.