Message-ID: <6afb74c5@news.ausics.net> From: not@telling.you.invalid (Computer Nerd Kev) Subject: Re: Shrinking huge PDF files Newsgroups: comp.os.linux.misc References: <%FfKS.6730$5s3.683@usenetxs.com> <11degfs$3d3uk$2@dont-email.me> User-Agent: tin/2.6.5-20251224 ("Glenury") (Linux/2.4.31 (i586)) NNTP-Posting-Host: news.ausics.net Date: 17 Nov 2026 07:25:25 +1000 Organization: Ausics - https://newsgroups.ausics.net Lines: 37 X-Complaints: abuse@ausics.net Path: csiph.com!news.bbs.nz!news.ausics.net!not-for-mail Xref: csiph.com comp.os.linux.misc:95734 Charlie Gibbs wrote: > On 2026-11-16, Nuno Silva wrote: >> Consider having a look at ImageMagick's convert with -lat, "local >> adaptive thresholding". Sadly, my notes don't go beyond saying it's >> better than just threshold... example command line: >> >> convert in.pnm -lat 100x700-15% out.pbm >> >> > > That sounds interesting! I'll give it a look. If you're not just after a quick fix, I've had some success with this script which runs a sequence of ImageMagick filters including "-lat": http://www.fmwconcepts.com/imagemagick/textcleaner/index.php As shown by the examples, it can take quite a few goes to narrow down on the best arguments to use for a particular document. Its greyscale output can be converted to monochrome with an appropriate threshold (ImageMagick can do this too) if desired. >> (unpaper might also be useful, depending on how the input documents >> are?:) >> >> Interesting, I might try that out. Another program that has some similar features is Scan Tailor. I've only used the original, but there's a maintained fork called Tcan Tailor Advanced here: https://scantailor.net/ -- __ __ #_ < |\| |< _#