Skip to content

Instantly share code, notes, and snippets.

@jdmichaud
Last active January 18, 2026 15:36
Show Gist options
  • Select an option

  • Save jdmichaud/407732a8614d411004b2f348aac9f791 to your computer and use it in GitHub Desktop.

Select an option

Save jdmichaud/407732a8614d411004b2f348aac9f791 to your computer and use it in GitHub Desktop.
scanimage notes

List devices:

scanimage --list-devices

Get device capability:

scanimage --help --device-name=brother4

Do not use /dev path here but the first part of the device string provided by the list devices command:

brother4:bus2;dev1 -> brother4

Scan all the files in the automatic document feeder:

scanimage --source "ADF Duplex" --resolution 300 --mode Gray --format=tiff --batch=bank_statement_p%04d.tiff

Be careful to use a pattern in the --batch argument. Without it, the same file would be overwritten again and again.

For OCR

prefer True Gray than Gray. Gray produce dithering and is used to simulate Grayscale on scanner only able to do black and white. Although resolution can propose very high values (9600 dpi) only some of those are managed natively by the scanner. A 300 dpi scanner can produce a 9600dpi scan but it just will be interpolated (no real quality gain). Prefer TIFF (lossless). scanimage does not produce compressed TIFF which can generate big files. You can compress on the fly with imagemagick:

scanimage --format=tiff | convert -compress LZW tiff:- page1.tiff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment