1scanimage(1)             SANE Scanner Access Now Easy             scanimage(1)
2
3
4

NAME

6       scanimage - scan an image
7

SYNOPSIS

9       scanimage  [-d|--device-name  dev]  [--format format] [-i|--icc-profile
10       profile]   [-L|--list-devices]   [-f|--formatted-device-list    format]
11       [--batch   [=format]]   [--batch-start   start]  [--batch-count  count]
12       [--batch-increment  increment]   [--batch-double]   [--accept-md5-only]
13       [-p|--progress] [-n|--dont-scan] [-T|--test] [-h|--help] [-v|--verbose]
14       [-B|--buffersize] [-V|--version] [device-specific-options]
15

DESCRIPTION

17       scanimage is a command-line  interface  to  control  image  acquisition
18       devices  such as flatbed scanners or cameras.  The device is controlled
19       via command-line options.   After  command-line  processing,  scanimage
20       normally  proceeds  to  acquire an image.  The image data is written to
21       standard output in one of the PNM (portable aNyMaP)  formats  (PBM  for
22       black-and-white  images,  PGM  for  grayscale images, and PPM for color
23       images) or in TIFF (black-and-white, grayscale  or  color).   scanimage
24       accesses image acquisition devices through the SANE (Scanner Access Now
25       Easy) interface and can thus support any device for which there  exists
26       a SANE backend (try apropos sane- to get a list of available backends).
27
28

EXAMPLES

30       To get a list of devices:
31
32         scanimage -L
33
34       To scan with default settings to the file image.pnm:
35
36         scanimage >image.pnm
37
38       To print all available options:
39
40         scanimage -h
41
42

OPTIONS

44       The  -d or --device-name options must be followed by a SANE device-name
45       like `epson:/dev/sg0' or `hp:/dev/usbscanner0'.  A  (partial)  list  of
46       available  devices  can be obtained with the --list-devices option (see
47       below).  If no device-name is specified explicitly, scanimage  reads  a
48       device-name from the environment variable SANE_DEFAULT_DEVICE.  If this
49       variable is not set, scanimage will attempt to open the first available
50       device.
51
52       The  --format  format option selects how image data is written to stan‐
53       dard output.  format can be pnm or tiff.  If --format is not used,  PNM
54       is written.
55
56       The -i or --icc-profile option is used to include an ICC profile into a
57       TIFF file.
58
59       The -L or --list-devices option requests a (partial)  list  of  devices
60       that are available.  The list is not complete since some devices may be
61       available, but are not listed in any of the configuration files  (which
62       are  typically  stored in directory /etc/sane.d).  This is particularly
63       the case when accessing scanners through the network.  If a  device  is
64       not listed in a configuration file, the only way to access it is by its
65       full device name.  You may need to consult your system administrator to
66       find out the names of such devices.
67
68       The  -f  or  --formatted-device-list  option  works  similar to --list-
69       devices, but requires a format string.  scanimage replaces  the  place‐
70       holders  %d  %v %m %t %i with the device name, vendor name, model name,
71       scanner type and an index number respectively. The command
72
73              scanimage -f scanner number %i device %d is a  %t,  model  %m,
74              produced by %v 
75
76       will produce something like:
77
78              scanner  number 0  device sharp:/dev/sg1 is  a  flatbed scanner,
79              model JX250 SCSI, produced by SHARP
80
81       The --batch* options provide the features for scanning documents  using
82       document  feeders.   --batch  [format] is used to specify the format of
83       the filename that each page will be written to.  Each page  is  written
84       out  to  a  single  file.   If  format is not specified, the default of
85       out%d.pnm (or out%d.tif for --format tiff) will  be  used.   format  is
86       given  as  a  printf style string with one integer parameter.  --batch-
87       start start selects the page number to start naming files with. If this
88       option  is not given, the counter will start at 0.  --batch-count count
89       specifies the number of pages to attempt to scan.  If not given,  scan‐
90       image  will  continue  scanning until the scanner returns a state other
91       than OK.  Not all scanners with document feeders signal when the ADF is
92       empty,  use  this  command to work around them.  With --batch-increment
93       increment you can change the amount that the number in the filename  is
94       incremented  by.   Generally this is used when you are scanning double-
95       sided documents on a single-sided document feeder.  A specific  command
96       is  provided  to  aid  this:  --batch-double will automatically set the
97       increment to 2.  --batch-prompt will ask  for  pressing  RETURN  before
98       scanning  a  page. This can be used for scanning multiple pages without
99       an automatic document feeder.
100
101       The --accept-md5-only option only accepts user  authorization  requests
102       that  support  MD5 security. The SANE network daemon (saned) is capable
103       of doing such requests. See saned(8).
104
105       The -p or --progress option requests that scanimage prints  a  progress
106       counter.  It shows how much image data of the current image has already
107       been received by scanimage (in percent).
108
109       The -n or --dont-scan option requests  that  scanimage  only  sets  the
110       options  provided by the user but doesn't actually perform a scan. This
111       option can be used to e.g. turn off the scanner's lamp (if supported by
112       the backend).
113
114       The  -T  or --test option requests that scanimage performs a few simple
115       sanity tests to make sure the backend works as defined by the SANE  API
116       (in particular the sane_read function is exercised by this test).
117
118       The  -h or --help options request help information.  The information is
119       printed on standard output and in this case, no attempt will be made to
120       acquire an image.
121
122       The  -v or --verbose options increase the verbosity of the operation of
123       scanimage.  The option may be specified repeatedly, each time  increas‐
124       ing the verbosity level.
125
126       The -B or --buffersize option changes the input buffersize that scanim‐
127       age uses from default 32*1024 to 1024*1024 kbytes.
128
129       The -V or --version option requests that scanimage prints  the  program
130       and  package  name, the version number of the SANE distribution that it
131       came with and the version of the backend that it loads. Usually  that's
132       the  dll  backend. If more information about the version numbers of the
133       backends are necessary, the DEBUG variable for the dll backend  can  be
134       used. Example: SANE_DEBUG_DLL=3 scanimage -L.
135
136       As  you  might  imagine,  much of the power of scanimage comes from the
137       fact that it can control any SANE backend.  Thus, the exact set of com‐
138       mand-line  options  depends on the capabilities of the selected device.
139       To see the options for a device named dev, invoke scanimage via a  com‐
140       mand-line of the form:
141
142              scanimage --help --device-name dev
143
144       The  documentation for the device-specific options printed by --help is
145       best explained with a few examples:
146
147        --brightness -100..100% [0]
148           Controls the brightness of the acquired image.
149
150              The description above shows that option --brightness expects  an
151              option  value  in the range from -100 to 100 percent.  The value
152              in square brackets indicates that the current option value is  0
153              percent.
154
155        --default-enhancements
156           Set default values for enhancement controls.
157
158              The  description  above shows that option --default-enhancements
159              has no option value.  It should be thought of as having an imme‐
160              diate  effect  at  the  point  of  the  command-line at which it
161              appears.  For example, since this option resets the --brightness
162              option,  the  option-pair --brightness 50 --default-enhancements
163              would effectively be a no-op.
164
165        --mode Lineart|Gray|Color [Gray]
166           Selects the scan mode (e.g., lineart or color).
167
168              The description above shows that option --mode accepts an  argu‐
169              ment  that  must  be one of the strings Lineart, Gray, or Color.
170              The value in the square bracket indicates  that  the  option  is
171              currently set to Gray.  For convenience, it is legal to abbrevi‐
172              ate the string values as long as they remain unique.  Also,  the
173              case  of  the spelling doesn't matter.  For example, option set‐
174              ting --mode col is identical to --mode Color.
175
176        --custom-gamma[=(yes|no)] [inactive]
177           Determines whether a builtin or a custom gamma-table
178           should be used.
179
180              The description above shows that option  --custom-gamma  expects
181              either no option value, a "yes" string, or a "no" string.  Spec‐
182              ifying the option with no  value  is  equivalent  to  specifying
183              "yes".   The  value in square-brackets indicates that the option
184              is not currently active.  That is, attempting to set the  option
185              would  result in an error message.  The set of available options
186              typically depends on the settings of other options.   For  exam‐
187              ple,  the  --custom-gamma  table  might  be  active  only when a
188              grayscale or color scan-mode has been requested.
189
190              Note that the --help option is processed only  after  all  other
191              options  have been processed.  This makes it possible to see the
192              option settings for a particular mode by specifying  the  appro‐
193              priate  mode-options along with the --help option.  For example,
194              the command-line:
195
196              scanimage --help --mode color
197
198              would print the option settings that  are  in  effect  when  the
199              color-mode is selected.
200
201        --gamma-table 0..255,...
202           Gamma-correction table.  In color mode this option
203           equally affects the red, green, and blue channels
204           simultaneously (i.e., it is an intensity gamma table).
205
206              The  description  above  shows that option --gamma-table expects
207              zero or more values in the range 0 to 255.  For example, a legal
208              value  for this option would be "3,4,5,6,7,8,9,10,11,12".  Since
209              it's cumbersome to specify long vectors in this form,  the  same
210              can  be  expressed  by  the abbreviated form "[0]3-[9]12".  What
211              this means is that the first vector element is  set  to  3,  the
212              9-th element is set to 12 and the values in between are interpo‐
213              lated linearly.  Of course, it is possible to  specify  multiple
214              such  linear segments.  For example, "[0]3-[2]3-[6]7,[7]10-[9]6"
215              is   equivalent   to   "3,3,3,4,5,6,7,10,8,6".    The    program
216              gamma4scanimage  can  be used to generate such gamma tables (see
217              gamma4scanimage(1) for details).
218
219        --filename <string> [/tmp/input.ppm]
220           The filename of the image to be loaded.
221
222              The description above is an example of an option that  takes  an
223              arbitrary string value (which happens to be a filename).  Again,
224              the value in brackets show that the option is current set to the
225              filename /tmp/input.ppm.
226
227

ENVIRONMENT

229       SANE_DEFAULT_DEVICE
230              The default device-name.
231

FILES

233       /etc/sane.d
234              This  directory holds various configuration files.  For details,
235              please refer to the manual pages listed below.
236
237       ~/.sane/pass
238              This file contains lines of the form
239
240              user:password:resource
241
242              scanimage uses this information  to  answer  user  authorization
243              requests  automatically.  The file must have 0600 permissions or
244              stricter. You should use  this  file  in  conjunction  with  the
245              --accept-md5-only  option  to  avoid  server-side  attacks.  The
246              resource may contain any character but is limited to 127 charac‐
247              ters.
248

SEE ALSO

250       sane(7),    gamma4scanimage(1),   xscanimage(1),   xcam(1),   xsane(1),
251       scanadf(1), sane-dll(5), sane-net(5), sane-"backendname"(5)
252

AUTHOR

254       David Mosberger, Andreas Beck, Gordon Matzigkeit, Caskey  Dickson,  and
255       many  others.   For questions and comments contact the sane-devel mail‐
256       inglist (see http://www.sane-project.org/mailing-lists.html).
257
258

BUGS

260       For vector options, the help output currently has no indication  as  to
261       how many elements a vector-value should have.
262
263
264
265sane-backends 1.0.18              23 Sep 2005                     scanimage(1)
Impressum