cyanfish / naps2

Scan documents to PDF and more, as simply as possible.
https://www.naps2.com
Other
2.86k stars 327 forks source link

colour pdf size - compression #80

Open McFisch1337 opened 1 year ago

McFisch1337 commented 1 year ago

Is your feature request related to a problem? Please describe. The sizes of my scanned pdf in s/w are very good (small) but in some usecases i have to scan in colour. A 2-sided 24bit pdf with qualitiy 40% is round about 1,5 MB. The same pdf scanned with Brother iPrint&Scan is 235kb I´m using a Brother 4700w at the moment.

Describe the solution you'd like Is there a possibility to add some pdf compressions like mrc? or to change the bitrate to 12bit. This could minimize the pdf´s. In the office we have a large MFC from Canon, the scanner makes 24bit pdf round about 150kb per page.

Additional context I use NAPS daily and love it. Hope you have a solution for the large files.

cyanfish commented 1 year ago

Can you attach a sample PDF from Canon + NAPS2 for comparison? There are a number of ways to compress a PDF and I'd be curious to see what's used.

McFisch1337 commented 1 year ago

Hi Ben,

thanks for your reply.

Atteched some pdf´s scanned with NAPS - iPrint&Scan - Capture Pro. All with the same Twain settings. The Canon MFC scans directly to smb without OCR.

The quality after compression with iPringt&Scan is not so good. The Capture Pro and Canon files are quite good.

I hope these files can help you. Kodak S2060w - NAPS2.pdf Brother 4700w - iPrint+Scan.pdf Brother 4700w - NAPS2.pdf Canon 3525i.pdf Kodak S2060w - Capture Pro 2.pdf

christianclavet commented 1 year ago

I've implemented this on my fork, from an old pull request from Luca De Petrillo that was sent here years ago. It add JPG codec to the compression and we can change the compression quality. I had to adapt it since the code was there from a long time and rewrite it.

It work really well. Using it in combination of MAX Quality in your profile, allow you to keep your source at full quality without any losses (PNG), and then tweak the PDF Export to your liking to have the best file size and quality. Also since the source is not degraded, you can do edits and it still look perfect.

Was able to get almost a ratio of 5/1 on certain PDF files (75% quality). To propose a new Pull Request I need to get accustomed with this new code since that was done with the 6.1.2 source.

LMSSonos commented 8 months ago

@christianclavet would you mind to let me know which commit this was in your PR as I would try to make a PR for the current version as it would be great to have this feature, because PDFs with NAPS2 are currently 10x-12x times larger than using acrobat standard

alleluia20 commented 3 months ago

Well, I did read this thread before posting #427, and I am not so sure that my submission was a duplicate. Anyway, I continue replying here, on the open bug,

In #427, I was not pointing out the poor compression of the PDFs generated by NAPS2. What I was telling is that other devices (the Sharp photocopier, in my case) return a PDF with bigger size that NAPS2, but much easier to compress with other tools. Compressing the NAPS2 PDF with the same tools results in much larger size and much worse quality. So the problem is not (only) compression: the problem is (also) before compression.

Please read #427 for details.

cyanfish commented 3 months ago

@alleluia20 There is one thing you can try which is "Document Correction" under the Image menu - that can reduce noise in the image which could potentially make it more compressible by these other tools.