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
Username:
Password:
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  

shackers

United Kingdom
7 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:
https://www.imageen.com/ieforum/topic.asp?TOPIC_ID=2878

They don't help much.

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

ImageEnIO.LoadFromFileAuto(OpenDialog1.FileName);               
ImageEnIO.params.PNG_Filter := ioPNG_FILTER_ALL;
ImageENIO.params.ResetInfo;
ImageEnIO.params.PNG_Compression := 9;
ImageEnIO.SaveToFilePng(FileName);


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

xequte

4981 Posts

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

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?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

shackers

United Kingdom
7 Posts

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

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

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