Monday, January 15, 2007

Scanning a bunch of photos at once using scanimage in linux

Just replace the plustek:libusb:001:002 with whatever sane-find-scanner comes up with for your scanner. This script, once started, will just keep looping. It starts at 2.jpg incidentally, but you are free to modify it if that bothers you.

You will end up with a directory of images, hitting enter between each scan, so that you have ample time to swap the image on the scanner head.

The measurements below are set up for a 4x6 picture at the marked corner of the flatbed.


#!/bin/bash
VAL=1
while true; do
VAL=`expr $VAL + 1`
echo "Now scanning $VAL.jpg"
scanimage --resolution=300 --depth=16 -d plustek:libusb:001:002 -l 0 -t 0 -x 151 -y 101 > output.pnm
convert output.pnm $VAL.jpg
echo "Press enter for next scan"
read

done


Requirements
1. Sane, along with the various sane utility packages.
2. Imagemagick
3. Bash
4. Compatible scananer.

Labels: , ,

0 Comments:

Post a Comment

<< Home