Optimization improvements

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: Tracker Support, TrackerSupp-Daniel, Paul - Tracker Supp, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Tracker Supp-Stefan, Ivan - Tracker Software

Post Reply
Timur Born
User
Posts: 572
Joined: Tue Jun 26, 2012 1:50 pm

Optimization improvements

Post by Timur Born » Tue Apr 24, 2018 1:42 pm

Hello,

today I tried to optimize an image heavy PDF (12 pages) down from its original size of 22.4 mb. Unfortunately Editor was only able to optimize it down to 18.7 mb, even with enforced (averaged) downsampling to 150 dpi and "Minimum" JPG quality. As a comparison, PDF24 managed to compress the same file down to 5.5 mb at minimum JPG quality and about 6.6 mb at 75% JPG quality. Even at "Maximum" JPG quality Editor's output images are marred with more JPG artifacts than PDF24's output at 75% JPG quality.

I think the reason for Editor's inability to compress the images further down is due to its downsampling algorithms. Bikubik is sharpest, Average is a bit smoother and the unnamed one's output is sharp but blocky to the point that I wonder why it's even an option. What is missing is a really smooth algorithm that would match the smoothness of PDF24's output and thus allow for much better JPG compression at any JPG quality setting.

Frankly, at its current state I always shied away from Editor's optimization function, especially because of the bad JPG compression output. There also is no way to calculate the final file size without actually saving the file, PDF24 offers such a function and thus makes hitting a target size easier.

On a positive side-note: This specific document optimized by Editor can be compressed to smaller sizes via 7Z or RAR compared to those compressed with PDF24, even though the Editor files start at a bigger size. One reason may be that many of the 238 images in that file are just carbon copies and PDF24 curiously increases the image count to 276.

User avatar
Patrick-Tracker Supp
Site Admin
Posts: 1668
Joined: Thu Mar 27, 2014 6:14 pm
Location: Vancouver Island
Contact:

Re: Optimization improvements

Post by Patrick-Tracker Supp » Tue Apr 24, 2018 11:36 pm

Hello Timur,

Thank you for the post. Could you please provide some supporting files so that we might take this to the dev team for consideration?
Thank you!
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Cheers,

Patrick Charest
Tracker Support North America

Timur Born
User
Posts: 572
Joined: Tue Jun 26, 2012 1:50 pm

Re: Optimization improvements

Post by Timur Born » Tue Apr 24, 2018 11:47 pm

I sent an e-mail with three sample files: The original, Editor's optimized version ("Minimum" JPG quality, average resampling) and PDF24's optimized version (75% JPG quality).

User avatar
TrackerSupp-Daniel
Site Admin
Posts: 2171
Joined: Wed Jan 03, 2018 6:52 pm

Re: Optimization improvements

Post by TrackerSupp-Daniel » Thu Apr 26, 2018 11:46 pm

Hi Timur,

We've received your email, and after the day of investigation the Development team has requested we make it into an internal development ticket for them to reference while they asses this. and work on it.

I am sorry we do not have an immediate solution, but we are working on it.
Daniel McIntyre
Support Technician
Tracker Software Products (Canada) LTD

Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623

Timur Born
User
Posts: 572
Joined: Tue Jun 26, 2012 1:50 pm

Re: Optimization improvements

Post by Timur Born » Fri Apr 27, 2018 10:02 am

Thanks and no problem, I can use PDF24 in the meantime and really don't need it often. Overall I am more concerned about the compression bugs that I reported about in September and just revisited in another thread.

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13296
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Optimization improvements

Post by Tracker Supp-Stefan » Fri Apr 27, 2018 12:54 pm

Thanks for the understanding Timur,

I will look at the other topic now as well!

Cheers,
Stefan

Special
User
Posts: 128
Joined: Fri Jan 31, 2014 9:24 pm

Re: Optimization improvements

Post by Special » Fri Apr 27, 2018 2:08 pm

Timur Born wrote:There also is no way to calculate the final file size without actually saving the file, PDF24 offers such a function and thus makes hitting a target size easier.
This part always bugged the hell out of me that the Editor cannot do, I'm going to have to check out PDF24 now if it can calculate an end result file size.

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13296
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Optimization improvements

Post by Tracker Supp-Stefan » Fri Apr 27, 2018 2:34 pm

Hi All,

To show anything other than approximation - that other tool is most likely doing most of the conversion in the background - otherwise providing an exact estimate is really tricky!
I will ask our devs if we can include some form of estimation in the Editor as well!

Regards,
Stefan

Timur Born
User
Posts: 572
Joined: Tue Jun 26, 2012 1:50 pm

Re: Optimization improvements

Post by Timur Born » Fri Apr 27, 2018 2:49 pm

This is indeed very likely the case. CPU load and estimation time of very large documents supports that assumption.

Special
User
Posts: 128
Joined: Fri Jan 31, 2014 9:24 pm

Re: Optimization improvements

Post by Special » Fri Apr 27, 2018 4:43 pm

I would love even a rough ballpark.

User avatar
Patrick-Tracker Supp
Site Admin
Posts: 1668
Joined: Thu Mar 27, 2014 6:14 pm
Location: Vancouver Island
Contact:

Re: Optimization improvements

Post by Patrick-Tracker Supp » Fri Apr 27, 2018 10:50 pm

Hi Guys,

I have added these points to the ticket, as well as the issues mentioned here: viewtopic.php?f=62&t=29531

Thank you for your patience and understanding while we work towards a solution.

Sincerely,
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Cheers,

Patrick Charest
Tracker Support North America

HaPe
User
Posts: 160
Joined: Wed Oct 29, 2014 9:34 pm

Re: Optimization improvements

Post by HaPe » Fri Apr 27, 2018 11:05 pm

Didn't know about PDF24,so I thought I give it a try myself (all "tests" were done with default settings)

17MByte file 43pages => new file size after "compression" : 20 MByte :(

88MByte file 934 pages => new file size after compression : 80 MByte :|
compression of the 88 MByte-file took 8 Minutes :(
(it's better to skip the calculation time and to save the file right away otherwise one will have
to wait ages - in this case 16minutes......

155 MByte file containing only 9 pictures (each picture 15-20MByte) => compressed : 9MByte/good quality :)
compression time less than 1 minute :)
====================================================================
same test with PDF-XChange:
17 MByte file 43pages => new file size after compression : 12 MByte :)

88 MByte file 934 pages => new file size after compression : 49 MByte :) :)
compression time about 2 Minutes :)

155MByte file containing only 9 pictures (each picture 15-20MByte) => compressed : 4 MByte/good quality :)
compression more less than 2 minute - not as fast that of PDF24

================================================================
This "test" is of course not representative,but I hope that any changes made to the current compression algorithm
will not affect my results achieved with PDF-XChange......

User avatar
TrackerSupp-Daniel
Site Admin
Posts: 2171
Joined: Wed Jan 03, 2018 6:52 pm

Re: Optimization improvements

Post by TrackerSupp-Daniel » Fri Apr 27, 2018 11:15 pm

Quite to the contrary,
Any changes to the algorithm should improve the results with PDF-XChange, Not make them worse :)
Daniel McIntyre
Support Technician
Tracker Software Products (Canada) LTD

Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623

Timur Born
User
Posts: 572
Joined: Tue Jun 26, 2012 1:50 pm

Re: Optimization improvements

Post by Timur Born » Mon Apr 30, 2018 1:01 pm

PDF24 always resamples and recompresses images to whatever DPI you set up (default 144). So you can end up with larger sizes if your original images were smaller than what you set up in PDF24. Editor comes with useful options to circumvent these traps. But the current output of Editor is too large and sometimes even of considerably lower quality, despite the larger size.

User avatar
TrackerSupp-Daniel
Site Admin
Posts: 2171
Joined: Wed Jan 03, 2018 6:52 pm

Re: Optimization improvements

Post by TrackerSupp-Daniel » Mon Apr 30, 2018 5:26 pm

Hi Timur,
Thank you for reiterating those points, we are looking into it, and will continue to work on improvements.
Daniel McIntyre
Support Technician
Tracker Software Products (Canada) LTD

Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623

bqxmprij
User
Posts: 103
Joined: Tue Dec 18, 2012 3:51 am

Re: Optimization improvements

Post by bqxmprij » Mon Apr 30, 2018 5:42 pm

Timur Born wrote:Hello,

today I tried to optimize an image heavy PDF (12 pages) down from its original size of 22.4 mb. Unfortunately Editor was only able to optimize it down to 18.7 mb, even with enforced (averaged) downsampling to 150 dpi and "Minimum" JPG quality. As a comparison, PDF24 managed to compress the same file down to 5.5 mb at minimum JPG quality and about 6.6 mb at 75% JPG quality. Even at "Maximum" JPG quality Editor's output images are marred with more JPG artifacts than PDF24's output at 75% JPG quality.

I think the reason for Editor's inability to compress the images further down is due to its downsampling algorithms. Bikubik is sharpest, Average is a bit smoother and the unnamed one's output is sharp but blocky to the point that I wonder why it's even an option. What is missing is a really smooth algorithm that would match the smoothness of PDF24's output and thus allow for much better JPG compression at any JPG quality setting.

Frankly, at its current state I always shied away from Editor's optimization function, especially because of the bad JPG compression output. There also is no way to calculate the final file size without actually saving the file, PDF24 offers such a function and thus makes hitting a target size easier.

On a positive side-note: This specific document optimized by Editor can be compressed to smaller sizes via 7Z or RAR compared to those compressed with PDF24, even though the Editor files start at a bigger size. One reason may be that many of the 238 images in that file are just carbon copies and PDF24 curiously increases the image count to 276.
Try printing the pdf with PDF-Exchange Standard to a new pdf. You will have to adjust the settings to compress the images, but this always works better for me than the optimization feature.

User avatar
TrackerSupp-Daniel
Site Admin
Posts: 2171
Joined: Wed Jan 03, 2018 6:52 pm

Re: Optimization improvements

Post by TrackerSupp-Daniel » Mon Apr 30, 2018 5:47 pm

Hi bqxmprij
While it may work better for file size, please be aware that the results of printing a PDF to PDF are not always ideal. This process can lead to eventual document corruption.
Simply be wary whenever using this as a workaround, and be sure to keep a stable copy of the original document if you are planning to take this route.
Daniel McIntyre
Support Technician
Tracker Software Products (Canada) LTD

Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623

Timur Born
User
Posts: 572
Joined: Tue Jun 26, 2012 1:50 pm

Re: Optimization improvements

Post by Timur Born » Tue May 01, 2018 8:08 am

Since I recently discovered that Editor's optimization does not properly compress stamps and that differently sized images are handled differently I can imagine that the whole optimization process is somewhat flawed for the time being. So comparisons are currently rather meaningless until we know that those bugs are ironed out. In the meantime I will use PDF24 (Ghostscript) when I need good recompression in combination with good image quality.

Reprinting is no real alternative, because the results are often flawed for my type of documents, both out of Editor (no proper Type 1 font support) and Adobe Reader (tends to introduce blank 1 pt lines in image parts).
Last edited by Timur Born on Tue May 01, 2018 8:22 am, edited 1 time in total.

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13296
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Optimization improvements

Post by Tracker Supp-Stefan » Tue May 01, 2018 8:19 am

Hello Timur,

We do what we can with compression, but indeed there might be some more optimal approaches in some scenarios.
We will continue investigating and improving as much as we can in this respect!

Regards,
Stefan

Timur Born
User
Posts: 572
Joined: Tue Jun 26, 2012 1:50 pm

Re: Optimization improvements

Post by Timur Born » Tue May 01, 2018 10:57 am

Here is a comparison image to demonstrate that the differences are not subtle.
Editor_vs_PDF24_150dpi.png
Editor_vs_PDF24_150dpi.png (24.72 KiB) Viewed 810 times
PS: "Maximum" seems to be roughly 85% JPG quality?!

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13296
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Optimization improvements

Post by Tracker Supp-Stefan » Tue May 01, 2018 11:59 am

Thanks for the sample Timur!

Regards,
Stefan

Post Reply