Kodak Alaris Inc.
SANE Driver Command
Line Interface
25-March-2015
Contents
There
are many command line options available when running SANE drivers on Linux. For
the most part, they are the same whether entered on the “scanimage” command
line, or on the XSane UI. There are some differences that will be described in
the details.
Descriptions of the SANE options can be found here:
http://www.sane-project.org/man/scanimage.1.html
NOTE: not all SANE options are available/supported for all scanner
models.
To
get the current list of options, turn on your scanner, and enter “scanimage -h” or “scanimage --help” in a terminal window. The options and valid
values for the scanner will be shown, including the current default in square
brackets.
-d or --device-name
Allows you to select the specific scanner to use.
The value must be a scanner name (e.g.
kds_i2000:i2000). You can list a list of scanner names by using the -L command-line option (i.e. scanimage
-L).
It is highly recommended that you use this option.
This will send the commands directly to the specific scanner driver. Otherwise,
SANE will search (i.e. open and load) every installed scanner driver until it
finds the currently connected scanner. Not only will this slow down the start
of scanning, you could load a scanner driver that behaves badly when it doesn’t
have a connected scanner (e.g. take too long looking for the scanner, leaving
memory in use).
-b or --batch
Indicates you want to scan an entire stack of
document.
There are no values for this option.
Using this option will automatically save each image
into a file. If you do not use this option, then the image data is dumped to
the terminal window; so you need to re-direct the data to a file.
--preview
This will return just one image.
There are no values for this option.
--profiles
Allows you to select one of the existing setting
shortcuts. A setting shortcut is a collection of all the scanner settings in
one place. Therefore, this allows you to configure your entire session with
this one setting.
The list of valid values may change based on whether
the user created or deleted any shortcuts via the TWAIN driver interface. Some
values are: Default, “Black and White Perfect Page Document”,
“Color Perfect Page Document”, “Color Photograph”, and “Dual Stream Perfect Page Document”.
If you need to override any of the setting shortcut
settings, you may place those other scanning options after this one (e.g. --profile
Default --resolution 250).
NOTE: Not all values are available for all scanner models.
--mode
Selects the scanning mode.
Valid values are: Lineart, Gray, and Color.
Lineart is bitonal.
--depth
This indicates the bits per sample for the current --mode selection.
The values are 1
and 8.
NOTE: This is a read-only value, use --mode to get the appropriate depth.
--duplex
Allows you to select which side(s) of the document you
want to get an image of.
Valid values are: front,
back, and both.
NOTE: Do not use this option if you are using a --source option other than ADF or FB.
--source
Allows you to select where the documents are scanned
from (ADF and/or Flatbed), the elevator position (if equipped), as well as
which side(s) of the document you want to get an image of.
Valid values are: ADF,
“ADF Front”, “ADF Back”, “ADF Both”, “ADF Duplex”, Elev100, “Elev100 Front”,
“Elev100 Back”, “Elev100 Both”, “Elev100
Duplex” , Elev250, “Elev250 Front”, “Elev250 Back”, “Elev250
Both”, “Elev250 Duplex” , Elev500, “Elev500 Front”, “Elev500
Back”, “Elev500 Both”, “Elev500 Duplex” , Elev750, “Elev750 Front”,
“Elev750 Back”, “Elev750 Both”, “Elev750
Duplex”, Auto100, “Auto100 Front”, “Auto100 Back”, “Auto100
Both”, “Auto100 Duplex” , Auto250, “Auto250 Front”, “Auto250
Back”, “Auto250 Both”, “Auto250 Duplex” , Auto500, “Auto500 Front”,
“Auto500 Back”, “Auto500 Both”, “Auto500
Duplex” , Auto750, “Auto750 Front”, “Auto750 Back”, “Auto750
Both”, “Auto750 Duplex”, Auto, and FB.
The Auto
and FB options are only available
for scanners that also have a flatbed connected (either internally or as an
accessory)
The Elev* options are
only available for scanners that have an input elevator.
The Auto*
options are only available for scanners that have an input elevator and also
have a flatbed connected (either internally or as an accessory).
NOTE: Not all values are available for all scanner models.
--resolution
Allows you to select the dots per inch (dpi), which
largely determines the quality of the scanned image. While scanning at a
greater resolution produces a better quality image, it may also increase
scanning time and image size.
The valid values are: 75, 100, 150, 200, 240, 250, 300, 400, 500, 600 and 1200.
NOTE: Not all values are available for all scanner models.
--croppingmode
Allows you to select how the scanner will detect your
document as it is being fed through the scanner
Valid values are: Automatic,
and Fixed.
Automatic will find each document (regardless of size)
and will straighten any document that may have been fed crooked.
Fixed will return an image based on the area you specify
with the Geometry options.
Geometry
The following four options are used together to set
the fixed cropping window.
NOTE: You must also set --croppingmode to Fixed.
-l
The distance from the left edge of the scan area.
Values (which are in millimeters) range from 0 to 25.4 less than the maximum
scanning area width, in steps of 0.0999908. For example, if the maximum
scanning width is 215.9, the maximum for this option is 190.5.
-t
The distance from the top edge of the document.
Values (which are in millimeters) range from 0 to 25.4 less than the current
maximum paper length, in steps of 0.0999908. For example, if the
current maximum length is 355.6, the maximum for this option is 330.2.
-x
The width of the image, starting from -l.
Values (which are in millimeters) range from 25.4 to the maximum width of the scanning
area, in steps of 0.0999908. For example, 215.9 or 279.4.
NOTE: use this option or --page-width
-y 25.4...355.6mm (in steps of 0.0999908) [356]
The height of the image, starting from -t.
Values (which are in millimeters) range from 25.4 to the current maximum paper length,
in steps of 0.0999908. For example, 355.6 or 431.8.
NOTE: use this option or --page-height
--page-width
Allows you to select the width of the fixed cropped
image.
Values (which are in millimeters) range from 25.4 to the maximum width of the scanning
area, in steps of 0.0999908. For example, 215.9 or 279.4.
NOTE: You must also set --croppingmode to Fixed.
NOTE: use this option or -x
--page-height
Allows you to select the height of the fixed cropped
image.
Values (which are in millimeters) range from 25.4 to the current maximum paper length,
in steps of 0.0999908. For example, 355.6 or 431.8.
NOTE: You must also set --croppingmode to Fixed.
NOTE: use this option or -y
--brightness
Controls the brightness of the image.
Values range from -100
to 100 in steps of 1.
When --mode
is Gray or Color, the scanner will manually adjust the brightness based on
this value.
When --mode
is Lineart
and the --contrast option is not on
the command line, the scanner will manually adjust the grayscale threshold used
to determine if a pixel is black or white. This is also known as Fixed thresholding.
When --mode
is Lineart
and the --contrast option is on the
command line, it allows you to provide the scanner with the optimal settings to
produce the desired image quality. This is also known as ATP (Adaptive Threshold
Processing).
NOTE: When --mode is Lineart, --brightness acts more like a threshold
value. So increasing --brightness
will lower the threshold.
--contrast
Allows you to make an image sharper or softer.
Values range from -100
to 100 in steps of 1.
When --mode
is Gray or Color, the scanner will manually adjust the contrast based on this
value.
When --mode
is Lineart
and the --brightness option is not
on the command line, the scanner will analyze each document to determine the
optimal settings to produce the highest quality image. This is also known as iThresholding.
When --mode
is Lineart
and the --brightness option is on
the command line, it allows you to provide the scanner with the optimal
settings to produce the desired image quality. This is also known as ATP
(Adaptive Threshold Processing).
When --mode
is Lineart,
decreasing this value will make the image softer and reduce noise in the image,
while increasing this value will make the image clearer and make light
information more visible.
--bgcolor
Selects what color the camera will see where there is
no paper (i.e. imaging background).
Valid values are: Black
and White.
NOTE: Not all values are available for all scanner models.
--blankimagemode
Allows you to configure the scanner to not give blank
images to the scanning application.
Valid values are: none
and content.
If --blankimagemode is set to content, refer to the description of --blankimagecontent below.
--blankimagecontent
Images will be considered blank based on the document
content within the image. If the percent of content on the image is less than
or equal to this amount, the image is considered blank and will be deleted.
Values range from 0
to 100 in steps of 1.
This is only valid when --blankimagemode is set to content.
--imagerotateorthogonal
Allows you to select any rotation to be applied to the
electronic image after it has been scanned.
Valid values are: auto,
auto_90_degrees, auto_180_degrees, auto_270_degrees, 0_degrees,
90_degrees, 180_degrees, and 270_degrees.
The ‘auto’ values will perform automatic rotation. If
the orientation cannot be determined, the selected default rotation will occur
(i.e. for auto_90_degrees, the
document will be rotated 90 degrees).
NOTE: Not all values are available for all scanner models.
--colorsharpen
Increases the contrast of edges within color and
grayscale images.
Values range from 0
to 3 in steps of 1.
0 indicates no sharpening, 1 is Normal, 2 is High and 3 is
Exaggerated.
scanimage -d kds_i2000:i2000 --batch
--resolution 200 --mode color
Scans all the sheets of
paper in the i2000 scanner’s feeder, at 200DPI, using the color cameras.
scanimage -d kds_i2000:i2000 --batch
--resolution 200 --mode color --colorsharpen 3
Scans all the sheets of
paper in the feeder, at 200DPI, using the color cameras.
Applies maximum sharpening
to the scanned images.
scanimage -d kds_i2000:i2000 --batch
--resolution 200 --mode lineart --imagerotateorthogonal
90_degrees
Scans all the sheets of
paper in the feeder, at 200DPI, using the bitonal
cameras.
Applies 90 degree clockwise
rotation to the image after it has been located and deskewed.
scanimage -d kds_i2000:i2000 --batch
--profiles “Color Perfect Page Document” --colorsharpen
2
Scans all the sheets of
paper in the feeder using all settings from the profile. Overrides the
profile’s default value for sharpening with our specified value.
scanimage -d kds_i2000:i2000 --batch
--resolution 300 --mode lineart --brightness 10
--contrast -5
Scans all the sheets of
paper in the feeder, at 300DPI, using the bitonal
cameras. The brightness value of 10 will make the image slightly lighter, and
the contrast value of -5 will make the image slightly softer.
scanimage -d kds_i2000:i2000 --batch
--resolution 200 --mode color --blankimagemode
content --blankimagecontent 43
Scans all the sheets of
paper in the feeder, at 200DPI, using the color cameras.
Any image that has more content than the --blankimagecontent
value will be considered non-blank and will be given to the scanning
application.