anhtumai / image2pdf

5 stars 4 forks source link

image2pdf creates very large PDF files compared to img2pdf #2

Open haydonryan opened 1 year ago

haydonryan commented 1 year ago

Love this project! In my opinion python should not be used for system utilities at all which makes img2pdf not a good solution imo.

Compared to img2pdf this tool creates extremely large files. On a test jpg of 684,132 bytes in length it creates a 2,178,328 byte pdf, compared to 685,587 for img2pdf.

The main value prop of img2pdf is that it embeds the JPG container into the pdf, rather than re-encoding. Based on the time taken to run of the two tools, it looks like you're re-encoding. Would it be possible to add an embed option?

anhtumai commented 1 year ago

Thank you for the kind words. I use img2pdf Python tool and often come across dependencies problems (PackageNotFound, ...).

anhtumai commented 1 year ago

@haydonryan , if you want to find a tool to convert images to pdf, I highly recommend ImageMagick, it is written in C++ and very mature. Images to PDF was a solved problem in the C++ world long ago. In the Rust world, PDF utilities are not mature nor well-documented enough.

haydonryan commented 1 year ago

I appreciate the insight that you gave into the rust world. Totally agree on the immaturity. I have used ImageMagick in the past to watermark images.

I came across img2pdf and image2pdf via stack exchange where there was a post stating to convert cbz / cbr files and recommending img2pdf (and imgtk - java based).

anhtumai commented 1 year ago

@haydonryan i wonder what are the killer features of img2pdf that image magick doesnot have?

anhtumai commented 1 year ago

After discovering ImageMagick, I stoped working on this project since ImageMagick has already solved the same problem