View Single Post
Old 01-03-2023, 03:00 PM   #3
icq70610
Enthusiast
icq70610 will become famous soon enoughicq70610 will become famous soon enoughicq70610 will become famous soon enoughicq70610 will become famous soon enoughicq70610 will become famous soon enoughicq70610 will become famous soon enough
 
icq70610's Avatar
 
Posts: 49
Karma: 510
Join Date: Sep 2008
Device: PSR505
Quote:
Originally Posted by rkomar View Post
TIFF format is more about the wrapping than the encoding. You can compress using many different methods within a TIFF wrapper. I would suggest that you produce your black-and-white images as CCIT4 encoded TIFF files before calling gs to create the PDF file (i.e. use the option "-compress Group4" when running mogrify/convert). I'm not familiar with scantailor, but maybe it offers that option out of the box.

When I was first scanning my books, I would use convert to produce the TIFF files with CCIT4 compression. Then I would use tiffcp to combine the separate TIFF files into a single multi-page TIFF file. I would then use either tumble or tiff2pdf to convert the multi-page TIFF file into a PDF file. Then I would use gs as the last step to add PDFMARKS to the PDF file.

Nowadays I used pdfbeads, but that has become more complicated than my old way because the program is no longer maintained and is very difficult to get working on a modern system. I use my old copy of pdfbeads within an old linux distro running inside VirtualBox.
Thank you for the quick answer - pdfbeads -- interesting idea -- (vm i get it :-) ) - as for the other points above -- thats exactly what im currently doing and i wrote a crude bash wrapper for tryouts

but basically its the following.

qpdf --> explode all pdfs into single pdf pages
gs --> convert pdf to tiff (b/w tiffg4)
gs -q -dBATCH -dNOPAUSE -sDEVICE=tiffg4 -r300x300 -dFirstPage=1 -dLastPage=1 -sOutputFile=111.tif page-111.pdf
than loop over the tif -> pdf with img2pdf a "raw" wrapper without encoding https://gitlab.mister-muffin.de/josch/img2pdf
and than bulk all the PDF's together into a combined pdf.

rather crude - but i achieve good compression results on b/w images with minimal effort and quite reasonable quality. (please be aware that the input images should be b/w allready -- if they are grey the tiffg4 encode gives sometimes funky results.

though i share -- topic closed on my end -- but it was hell of frustrating :-) to get some grip on that.

\Pete
icq70610 is offline   Reply With Quote