| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| scan.sh | 2025-09-01 | 37.9 kB | |
| create_pdf_from_jpgs_imagemagick.sh | 2025-09-01 | 24.4 kB | |
| readme.md | 2025-08-29 | 3.8 kB | |
| Totals: 3 Items | 66.0 kB | 0 |
scan.sh - A Script for Scanning, Processing, and Saving Documents
scan.sh is a versatile Bash script designed to automate your document scanning workflow. It handles everything from capturing the image to processing and saving it in an organized way. The script supports various scanning modes, image formats, and offers multiple options for both simple and complex scanning tasks.
Features
- Scanning Modes: Choose between
color,gray, orlineartfor your scans. - Customizable Settings: Adjust DPI resolution and compression quality to meet your needs.
- Defined Scan Area: The script allows you to specify a custom scan area in millimeters, with a default for A4 size.
- Automatic Image Processing: The script automatically sharpens and resizes the scanned image to a target resolution, optimizing file size and quality.
- Multiple Output Formats: Save your files as
jpg(default),png,pdf, ortiff. - Organized File Naming: Files are automatically named with the current date, a sequential number, and an optional custom description.
- Serial Scanning (
serial): A mode that lets you scan multiple documents in a row, with the option to edit parameters after each scan. - Graphical Interface (
gui): Launches a graphical window to set parameters before scanning, which automatically enables serial mode. - Translation Option (
translate): Opens the scanned image in an image viewer and simultaneously opens Google Translate Images in your browser, making it easy to drag-and-drop the file for manual translation.
Installation
- Save the script code to a file, for example,
~/bin/scan.sh. - Give the file execute permissions:
bash chmod +x ~/bin/scan.sh - Ensure the
~/bin/directory is in your$PATHvariable so you can run the script from anywhere.
Dependencies
The script requires the following packages to function:
sane-utils(for thescanimagecommand)ImageMagick(for theconvertandmogrifycommands)kdialog(for displaying notifications)gwenview(or another image viewer likexdg-open)xdg-utils(forxdg-open, required for thetranslateoption)
Example installation commands for common Linux distributions:
- Debian/Ubuntu:
bash sudo apt update && sudo apt install sane-utils imagemagick kdialog gwenview xdg-utils - Arch Linux:
bash sudo pacman -Sy sane-utils imagemagick kdialog gwenview xdg-utils - openSUSE:
bash sudo zypper refresh && sudo zypper install ImageMagick sane-utils kdialog gwenview xdg-utils
Usage
Basic Syntax
./scan.sh [OPTION=VALUE] [...] [FLAG] [...]