190
submitted 4 months ago* (last edited 4 months ago) by Teppichbrand@feddit.org to c/selfhosted@lemmy.world

It's perfect! Do you guys already do this?

I open a letter, I take it's picture with FairScan. The FairScan-folder on my android device gets syncthinged to the ingest folder for Paperless-ngx on my "server". Paperless imports it, deletes the file and sets the new documents tag to inbox. I decide if the document goes to the binder for important stuff, or if I just toss it in a binder with all the paper I most likely will never touch again. Next time I look at Paperless, I edit all documents with the inbox tag and remove the tag.

you are viewing a single comment's thread
view the rest of the comments
[-] llii@discuss.tchncs.de 6 points 4 months ago

Its 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:

  1. scan pages as png via scanimage in gray scale
  2. convert the image into a high contrast b/w one with image magick
  3. sort pages if I have to combine two scans (front and back side)
  4. create a single pdf of all the document pages via image magick
  5. 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 1 points 4 months 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 1 points 4 months 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.png

It 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.

this post was submitted on 06 Feb 2026
190 points (99.0% liked)

Selfhosted

60426 readers
497 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS