ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder
ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 PNG Compression
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  


United Kingdom
12 Posts

Posted - Jan 20 2020 :  08:07:59  Show Profile  Reply
I am extracting images/pages from a pdf file using PDFIUM. They are rendered to bitmap and I then save them to PNG.

Getting the maximum compression/file size is extremely important.

I have used a opensource product called PDFToPNG to carry out the same exercise.

It achieves precisely the same quality of png (same dimensions, same bitdepth) but at broadly 25% of the file size achieved by ImageEnIO.

I have looked at the suggestions in this topic:

They don't help much.

I am currently extracting the bitmap from the PDF and then processing as follows:

ImageEnIO.params.PNG_Filter := ioPNG_FILTER_ALL;
ImageEnIO.params.PNG_Compression := 9;

Do you have any idea what more I can do to achieve anything close to the file size achieved by PDFToPNG?


5522 Posts

Posted - Jan 21 2020 :  20:00:34  Show Profile  Reply

There are two conversions being performed here:

1. PDF -> Bitmap
2. Bitmap -> PNG

Are you able to confirm that it is step 2, ImageEn's step, that causes the larger file?

I.e. is the Bitmap generated by PDFIUM and PDFtoPNG identical?

Xequte Software
Go to Top of Page


United Kingdom
12 Posts

Posted - Feb 13 2020 :  09:32:56  Show Profile  Reply

I'm afraid I can't confirm that. PDFToPng is a command line app that produces a PNG without access to any intermediate PDF.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To: