Comment on đ FairScan > Syncthing > Paperlees-ngx
llii@discuss.tchncs.de â¨3⊠â¨weeks⊠agoIts a hacked together shell script. I wanted to learn shell scripting, but I shouldâve probably programmed it in python.
But it basically does this:
- scan pages as png via scanimage in gray scale
- convert the image into a high contrast b/w one with image magick
- sort pages if I have to combine two scans (front and back side)
- create a single pdf of all the document pages via image magick
- move pdf to the paperless folder
I wonât share it because itâs really ugly and some of the functionality can be done with paperless native, like combining the pages of two scans. Which wouldâve been easier.
RazzleDazzle@discuss.tchncs.de â¨2⊠â¨weeks⊠ago
Thanks! And thatâs ok, Iâm more interested in the steps than the code itself. Do you apply any optimizations with image magik in step 2?
llii@discuss.tchncs.de â¨2⊠â¨weeks⊠ago
Yeah, I do this:
magick â$fileâ -limit memory 1GiB -limit map 2GiB -threshold 60% -define connected-components:area-threshold=5 -define connected-components:mean-color=true -connected-components 8 output.pngIt makes the scan 1-bit black and white. It mostly removes bright background images, if there are any on the pages. I think it works quite well for basic black and white documents, but color graphics and graphs arenât preserved.