I use to Linux commands: scanimage and convert.
We can see the script below:
1 2 3 4 5 6 | #!/bin/bash args=("$@") echo ${args[0]} exec `scanimage --mode=Color --format=PNM > ${args[0]}.raw ; convert ${args[0]}.raw ${args[0]}.jpg; rm ${args[0]}.raw;` |
Write the script in a text file. Named the script with this name scan.sh.
Run this :
1 | $sh scan.sh firstscan |
The output will be:
1 | firstscan.jpg |
You can use any name for the output. As we see in this example I used firstscan.