Optimization improvements

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

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

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

Optimization improvements

Post by Timur Born »

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: 1645
Joined: Thu Mar 27, 2014 6:14 pm
Location: Vancouver Island
Contact:

Re: Optimization improvements

Post by Patrick-Tracker Supp »

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: 874
Joined: Tue Jun 26, 2012 1:50 pm

Re: Optimization improvements

Post by Timur Born »

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: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: Optimization improvements

Post by TrackerSupp-Daniel »

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.
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Timur Born
User
Posts: 874
Joined: Tue Jun 26, 2012 1:50 pm

Re: Optimization improvements

Post by Timur Born »

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: 17823
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Optimization improvements

Post by Tracker Supp-Stefan »

Thanks for the understanding Timur,

I will look at the other topic now as well!

Cheers,
Stefan
Special
User
Posts: 144
Joined: Fri Jan 31, 2014 9:24 pm

Re: Optimization improvements

Post by Special »

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: 17823
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Optimization improvements

Post by Tracker Supp-Stefan »

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: 874
Joined: Tue Jun 26, 2012 1:50 pm

Re: Optimization improvements

Post by Timur Born »

This is indeed very likely the case. CPU load and estimation time of very large documents supports that assumption.
Special
User
Posts: 144
Joined: Fri Jan 31, 2014 9:24 pm

Re: Optimization improvements

Post by Special »

I would love even a rough ballpark.
User avatar
Patrick-Tracker Supp
Site Admin
Posts: 1645
Joined: Thu Mar 27, 2014 6:14 pm
Location: Vancouver Island
Contact:

Re: Optimization improvements

Post by Patrick-Tracker Supp »

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: 162
Joined: Wed Oct 29, 2014 9:34 pm

Re: Optimization improvements

Post by HaPe »

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: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: Optimization improvements

Post by TrackerSupp-Daniel »

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

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Timur Born
User
Posts: 874
Joined: Tue Jun 26, 2012 1:50 pm

Re: Optimization improvements

Post by Timur Born »

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: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: Optimization improvements

Post by TrackerSupp-Daniel »

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

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
bqxmprij
User
Posts: 162
Joined: Tue Dec 18, 2012 3:51 am

Re: Optimization improvements

Post by bqxmprij »

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: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: Optimization improvements

Post by TrackerSupp-Daniel »

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.
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Timur Born
User
Posts: 874
Joined: Tue Jun 26, 2012 1:50 pm

Re: Optimization improvements

Post by Timur Born »

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: 17823
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Optimization improvements

Post by Tracker Supp-Stefan »

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: 874
Joined: Tue Jun 26, 2012 1:50 pm

Re: Optimization improvements

Post by Timur Born »

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 5243 times
PS: "Maximum" seems to be roughly 85% JPG quality?!
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17823
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Optimization improvements

Post by Tracker Supp-Stefan »

Thanks for the sample Timur!

Regards,
Stefan
Post Reply