dennogumi/content/post/2007-07-04-command-line-scanning.markdown
Luca Beltrame 64b24842b8
All checks were successful
continuous-integration/drone/push Build is passing
Update all posts to not show the header text
2021-01-13 00:05:30 +01:00

1,008 B

author categories comments date slug title omit_header_text disable_share wordpress_id
einar
Linux
true 2007-07-04T21:26:31Z command-line-scanning Command line scanning true true 269

Recently, I had to do a few scans with my old but trusty BenQ 640BU. Given that I could not use any GUI due to a long-standing Feisty bug, I tried to settle for command line scanning with the scanimage command from SANE. The main problem is that scanimage only saves images in PNM or TIFF formats. I wanted to use JPEG or PNG, but apparently that looked impossible to do.

Instead, I found that scanimage sends its results to standard output, and also that ImageMagick can accept standard input as source file, it was easy to convert on the fly:

[code lang='c'] scanimage --format pnm | convert -format png - test.png [/code]

"-" tells convert to use the standard input. Another great example of the power of the command line.