SANE is Fully Scriptable
SANE frontends return images in the standard PNG format that can be
manipulated by all the standard Linux image-manipulation tools, such
as zgv, pbmtools, xv, ImageMagick, and the GIMP. Command-line
frontends like scanimage can be easily used, like all good Unix tools,
in shell scripts, or through pipes.
This means that you can easily add scanning to your own applications,
shell scripts, and so forth. Frontends are avaialable in TCL/Tk and
Perl, to name some other scripting languages.