sane-project-website/man/scanimage.1.html

369 wiersze
19 KiB
HTML

<HTML>
<HEAD>
<TITLE>scanimage.1</TITLE>
</HEAD>
<BODY BGCOLOR=#FFFFFF TEXT=#000000><H1 ALIGN=CENTER><IMG SRC="/images/sane.png" HEIGHT=117 WIDTH=346></H1>
<H1>scanimage.1</H1>
<HR>
<PRE>
<!-- Manpage converted by man2html 3.0.1 -->
<B><A HREF="scanimage.1.html">scanimage(1)</A></B> SANE Scanner Access Now Easy <B><A HREF="scanimage.1.html">scanimage(1)</A></B>
</PRE>
<H2>NAME</H2><PRE>
scanimage - scan an image
</PRE>
<H2>SYNOPSIS</H2><PRE>
<B>scanimage</B> [<B>-d</B> <I>dev</I>] [<B>--format</B><I>=output-format</I>] [<B>-i</B> <I>profile</I>] [<B>-L</B>] [<B>-f</B> <I>de-</I>
<I>vice-format</I>] [<B>-b</B> [<I>format</I>]] [<B>--batch-start</B><I>=start</I>] [<B>--batch-count</B><I>=count</I>]
[<B>--batch-increment</B><I>=increment</I>] [<B>--batch-double</B>] [<B>--accept-md5-only</B>] [<B>-p]</B>
[<B>-o</B> <I>path</I>] [<B>-n</B>] [<B>-T</B>] [<B>-A</B>] [<B>-h</B>] [<B>-v</B>] [<B>-B</B> size<I>]</I> [<B>-V</B>] [<I>device-specific-op-</I>
<I>tions</I>]
</PRE>
<H2>DESCRIPTION</H2><PRE>
<B>scanimage</B> is a command-line interface to control image acquisition de-
vices such as flatbed scanners or cameras. The device is controlled
via command-line options. After command-line processing, <B>scanimage</B>
normally proceeds to acquire an image. The image data is written to
standard output in one of the PNM (portable aNyMaP) formats (PBM for
black-and-white images, PGM for grayscale images, and PPM for color im-
ages), TIFF format (black-and-white, grayscale or color), PNG format,
or JPEG format (compression level 75). <B>scanimage</B> accesses image acqui-
sition devices through the <B>SANE</B> (Scanner Access Now Easy) interface and
can thus support any device for which there exists a <B>SANE</B> backend (try
<B>apropos</B> <I>sane-</I> to get a list of available backends).
</PRE>
<H2>EXAMPLES</H2><PRE>
To get a list of devices:
scanimage -L
To scan with default settings to the file image.pnm:
scanimage &gt;image.pnm
To scan 100x100 mm to the file image.tiff (-x and -y may not be avail-
able with all devices):
scanimage -x 100 -y 100 --format=tiff &gt;image.tiff
To print all available options:
scanimage -h
</PRE>
<H2>OPTIONS</H2><PRE>
There are two sets of options available when running <B>scanimage</B>.
The options that are provided by <B>scanimage</B> itself are listed below. In
addition, each backend offers its own set of options and these can also
be specified. Note that the options available from the backend may vary
depending on the scanning device that is selected.
Often options that are similar in function may be implemented differ-
ently across backends. An example of this difference is <I>--mode</I> <I>Gray</I> and
<I>--mode</I> <I>Grayscale</I>. This may be due to differing backend author prefer-
ences. At other times, options are defined by the scanning device it-
self and therefore out of the control of the backend code.
Parameters are separated by a blank from single-character options (e.g.
<B>-d</B> <I>epson</I>) and by a "=" from multi-character options (e.g. <B>--de-</B>
<B>vice-name</B>=<I>epson</I>).
<B>-d</B> <I>dev</I>, <B>--device-name</B>=<I>dev</I>
specifies the device to access and must be followed by a SANE
device-name like `<I>epson:/dev/sg0</I>' or `<I>hp:/dev/usbscanner0</I>'. A
(partial) list of available devices can be obtained with the
<B>--list-devices</B> option (see below). If no device-name is speci-
fied explicitly, <B>scanimage</B> reads a device-name from the environ-
ment variable <B>SANE_DEFAULT_DEVICE</B>. If this variable is not set,
<B>scanimage</B> will attempt to open the first available device.
<B>--format</B>=<I>output-format</I>
selects how image data is written to standard output or the file
specified by the <B>--output-file</B> option. <I>output-format</I> can be
<B>pnm</B>, <B>tiff</B>, <B>png</B>, or <B>jpeg</B>. If <B>--format</B> is not specified, PNM is
written by default.
<B>-i</B> <I>profile</I>, <B>--icc-profile</B>=<I>profile</I>
is used to include an ICC profile into a TIFF file.
<B>-L</B>, <B>--list-devices</B>
requests a (partial) list of devices that are available. The
list may not be complete since some devices may be available,
but are not listed in any of the configuration files (which are
typically stored in directory <I>/usr/local/etc/sane.d</I>). This is
particularly the case when accessing scanners through the net-
work. If a device is not listed in a configuration file, the
only way to access it is by its full device name. You may need
to consult your system administrator to find out the names of
such devices.
<B>-f</B> <I>format</I>, <B>--formatted-device-list</B>=<I>device-format</I>
works similarly to <B>--list-devices</B>, but requires a format string.
<B>scanimage</B> replaces the placeholders <B>%d</B> <B>%v</B> <B>%m</B> <B>%t</B> <B>%i</B> <B>%n</B> with the
device name, vendor name, model name, scanner type, an index
number and newline respectively. The command
<B>scanimage</B> <B>-f</B> <I>"</I> <I>scanner</I> <I>number</I> <I>%i</I> <I>device</I> <I>%d</I> <I>is</I> <I>a</I> <I>%t,</I> <I>model</I> <I>%m,</I>
<I>produced</I> <I>by</I> <I>%v</I> <I>"</I>
will produce something like:
scanner number 0 device sharp:/dev/sg1 is a flatbed
scanner, model JX250 SCSI, produced by SHARP
The <B>--batch*</B> options provide features for scanning documents using doc-
ument feeders.
<B>-b</B> [<I>format</I>], <B>--batch</B>=[<I>format</I>]
is used to specify the format of the filename that each
page will be written to. Each page is written out to a
single file. If <I>format</I> is not specified, the default of
<I>out%d.pnm</I> (or <I>out%d.tif</I> for <B>--format</B> <B>tiff</B>, <I>out%d.png</I> for
<B>--format</B> <B>png</B> or <I>out%d.jpg</I> for <B>--format</B> <B>jpeg</B>) will be
used. This option is incompatible with the <B>--output-path</B>
option. <I>format</I> is given as a printf style string with
one integer parameter.
<B>--batch-start</B>=<I>start</I>
selects the page number to start naming files with. If
this option is not given, the counter will start at 1.
<B>--batch-count</B>=<I>count</I>
specifies the number of pages to attempt to scan. If not
given, <B>scanimage</B> will continue scanning until the scanner
returns a state other than OK. Not all scanners with
document feeders signal when the ADF is empty. Use this
option to work around them.
<B>--batch-increment</B>=<I>increment</I>
sets the amount that the number in the filename is incre-
mented by. Generally this is used when you are scanning
double-sided documents on a single-sided document feeder.
<B>--batch-double</B> is a specific command provided to aid
this.
<B>--batch-double</B>
will automatically set the increment to 2. Equivalent to
<B>--batch-increment</B>=2.
<B>--batch-prompt</B>
will ask for pressing RETURN before scanning a page. This
can be used for scanning multiple pages without an auto-
matic document feeder.
<B>--accept-md5-only</B>
only accepts user authorization requests that support MD5 secu-
rity. The <B>SANE</B> network daemon <B><A HREF="saned.8.html">saned(8)</A></B> is capable of doing such
requests.
<B>-p</B>, <B>--progress</B>
requests that <B>scanimage</B> prints a progress counter. It shows how
much image data of the current image has already been received
(in percent).
<B>-o</B> <I>path</I>, <B>--output-file</B>=<I>path</I>
requests that <B>scanimage</B> saves the scanning output to the given
<I>path</I>. This option is incompatible with the <B>--batch</B> option. The
program will try to guess <B>--format</B> from the file name. If that
is not possible, it will print an error message and exit.
<B>-n</B>, <B>--dont-scan</B>
requests that <B>scanimage</B> only sets the options provided by the
user but doesn't actually perform a scan. This option can be
used to e.g. turn off the scanner's lamp (if supported by the
backend).
<B>-T</B>, <B>--test</B>
requests that <B>scanimage</B> performs a few simple sanity tests to
make sure the backend works as defined by the <B>SANE</B> API. In par-
ticular the <B>sane_read</B>() function is exercised by this test.
<B>-A</B>, <B>--all-options</B>
requests that <B>scanimage</B> lists all available options exposed by
the backend, including button options. The information is
printed on standard output and no scan will be performed.
<B>-h</B>, <B>--help</B>
requests help information. The information is printed on stan-
dard output and no scan will be performed.
<B>-v</B>, <B>--verbose</B>
increases the verbosity of the output of <B>scanimage</B>. The option
may be specified repeatedly, each time increasing the verbosity
level.
<B>-B</B> [<I>size</I>], <B>--buffer-size</B>=<I>size</I>
changes input buffer size from the default of 1MB to <I>size</I> KB.
<B>-V</B>, <B>--version</B>
requests that <B>scanimage</B> prints the program and package name, the
version number of the <B>SANE</B> distribution that it came with and
the version of the backend that it loads. If more information
about the version numbers of the backends are necessary, the <B>DE-</B>
<B>BUG</B> variable for the dll layer can be used. Example: <I>SANE</I><B>_</B><I>DE-</I>
<I>BUG</I><B>_</B><I>DLL=3</I> <I>scanimage</I> <I>-L</I>.
As you might imagine, much of the power of <B>scanimage</B> comes from the
fact that it can control any <B>SANE</B> backend. Thus, the exact set of com-
mand-line options depends on the capabilities of the selected device.
To see the options for a device named <I>dev</I>, invoke <B>scanimage</B> via a com-
mand-line of the form:
scanimage --help --device-name <I>dev</I>
The documentation for the device-specific options printed by <B>--help</B> is
best explained with a few examples:
<B>-l</B> <B>0..218mm</B> <B>[0]</B>
Top-left x position of scan area.
The description above shows that option <B>-l</B> expects an option
value in the range from 0 to 218 mm. The value in square brack-
ets indicates that the current option value is 0 mm. Most back-
ends provide similar geometry options for top-left y position
(<B>-t</B>), width (<B>-x</B>) and height of scan-area (-y<B>).</B>
<B>--brightness</B> <B>-100..100%</B> <B>[0]</B>
Controls the brightness of the acquired image.
The description above shows that option <B>--brightness</B> expects an
option value in the range from -100 to 100 percent. The value
in square brackets indicates that the current option value is 0
percent.
<B>--default-enhancements</B>
Set default values for enhancement controls.
The description above shows that option <B>--default-enhancements</B>
has no option value. It should be thought of as having an imme-
diate effect at the point of the command-line at which it ap-
pears. For example, since this option resets the <B>--brightness</B>
option, the option-pair <B>--brightness</B> <B>50</B> <B>--default-enhancements</B>
would effectively be a no-op.
<B>--mode</B> <B>Lineart|Gray|Color</B> <B>[Gray]</B>
Selects the scan mode (e.g., lineart or color).
The description above shows that option <B>--mode</B> accepts an argu-
ment that must be one of the strings <B>Lineart</B>, <B>Gray</B>, or <B>Color</B>.
The value in the square bracket indicates that the option is
currently set to <B>Gray</B>. For convenience, it is legal to abbrevi-
ate the string values as long as they remain unique. Also, the
case of the spelling doesn't matter. For example, option set-
ting <B>--mode</B> <B>col</B> is identical to <B>--mode</B> <B>Color</B>.
<B>--custom-gamma[=(yes|no)]</B> <B>[inactive]</B>
Determines whether a builtin or a custom gamma-table should be
used.
The description above shows that option <B>--custom-gamma</B> expects
either no option value, a "yes" string, or a "no" string. Spec-
ifying the option with no value is equivalent to specifying
"yes". The value in square-brackets indicates that the option
is not currently active. That is, attempting to set the option
would result in an error message. The set of available options
typically depends on the settings of other options. For exam-
ple, the <B>--custom-gamma</B> table might be active only when a
grayscale or color scan-mode has been requested.
Note that the <B>--help</B> option is processed only after all other
options have been processed. This makes it possible to see the
option settings for a particular mode by specifying the appro-
priate mode-options along with the <B>--help</B> option. For example,
the command-line:
<B>scanimage</B> <B>--help</B> <B>--mode</B> <I>color</I>
would print the option settings that are in effect when the
color-mode is selected.
<B>--gamma-table</B> <B>0..255,...</B>
Gamma-correction table. In color mode this option equally af-
fects the red, green, and blue channels simultaneously (i.e., it
is an intensity gamma table).
The description above shows that option <B>--gamma-table</B> expects
zero or more values in the range 0 to 255. For example, a legal
value for this option would be "3,4,5,6,7,8,9,10,11,12". Since
it's cumbersome to specify long vectors in this form, the same
can be expressed by the abbreviated form "[0]3-[9]12". What
this means is that the first vector element is set to 3, the
9-th element is set to 12 and the values in between are interpo-
lated linearly. Of course, it is possible to specify multiple
such linear segments. For example, "[0]3-[2]3-[6]7,[7]10-[9]6"
is equivalent to "3,3,3,4,5,6,7,10,8,6". The program
<B>gamma4scanimage</B> can be used to generate such gamma tables (see
<B><A HREF="gamma4scanimage.1.html">gamma4scanimage(1)</A></B> for details).
<B>--filename</B> <B>&lt;string&gt;</B> <B>[/tmp/input.ppm]</B>
The filename of the image to be loaded.
The description above is an example of an option that takes an
arbitrary string value (which happens to be a filename). Again,
the value in brackets show that the option is current set to the
filename <I>/tmp/input.ppm</I>.
</PRE>
<H2>ENVIRONMENT</H2><PRE>
<B>SANE_DEFAULT_DEVICE</B>
The default device-name.
</PRE>
<H2>FILES</H2><PRE>
<I>/usr/local/etc/sane.d</I>
This directory holds various configuration files. For details,
please refer to the manual pages listed below.
<I>~/.sane/pass</I>
This file contains lines of the form
user:password:resource
<B>scanimage</B> uses this information to answer user authorization re-
quests automatically. The file must have 0600 permissions or
stricter. You should use this file in conjunction with the <B>--ac-</B>
<B>cept-md5-only</B> option to avoid server-side attacks. The resource
may contain any character but is limited to 127 characters.
</PRE>
<H2>SEE ALSO</H2><PRE>
<B><A HREF="sane.7.html">sane(7)</A></B>, <B><A HREF="gamma4scanimage.1.html">gamma4scanimage(1)</A></B>, <B><A HREF="xscanimage.1.html">xscanimage(1)</A></B>, <B><A HREF="xcam.1.html">xcam(1)</A></B>, <B><A HREF="xsane.1.html">xsane(1)</A></B>,
<B><A HREF="scanadf.1.html">scanadf(1)</A></B>, <B><A HREF="sane-dll.5.html">sane-dll(5)</A></B>, <B><A HREF="sane-net.5.html">sane-net(5)</A></B>, <B>sane-"backendname"</B>(5)
</PRE>
<H2>AUTHOR</H2><PRE>
David Mosberger, Andreas Beck, Gordon Matzigkeit, Caskey Dickson, and
many others. For questions and comments contact the sane-devel mail-
inglist (see <I>http://www.sane-project.org/mailing-lists.html</I>).
</PRE>
<H2>BUGS</H2><PRE>
For vector options, the help output currently has no indication as to
how many elements a vector-value should have.
10 Jul 2008 <B><A HREF="scanimage.1.html">scanimage(1)</A></B>
</PRE>
<HR>
<ADDRESS>
Man(1) output converted with
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
</ADDRESS>
</BODY>
</HTML>