Skip to content

jernej13/pdf2scan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pdf2scan

Bash script for enhancing scanned/book PDFs. Renders pages to grayscale, applies gamma and contrast, optionally converts to 1-bit (threshold/adaptive), then merges into a compact printable PDF. Parallel and memory-aware.

demo

Requirements

Ghostscript, ImageMagick, img2pdf, GNU parallel, poppler

Ubuntu

sudo apt install ghostscript imagemagick img2pdf parallel poppler-utils

Fedora

sudo dnf install ghostscript ImageMagick img2pdf parallel poppler-utils

Arch

sudo pacman -S ghostscript imagemagick img2pdf parallel poppler

Usage

./pdf2scan.sh [options] input.pdf output.pdf

Options:

  • -d, --dpi render DPI (default 100)
  • -g, --gamma gamma correction
  • -c, --contrast brightness/contrast
  • -t, --threshold convert to 1-bit (e.g. 50%)
  • -a, --adaptive adaptive 1-bit
  • -q, --quality JPEG quality (default 60)
  • -v, --verbose verbose logs
  • -h, --help show help

About

Bash script for enchancing pdfs (images of books).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages