1SCANIMAGE-PERL(1) User Contributed Perl Documentation SCANIMAGE-PERL(1)
2
3
4
6 scanimage - scan an image
7
9 scanimage [ -d | --device-name dev ] [ --format format ] [ -i |
10 --icc-profile profile ] [ -L | --list-devices ] [ -f |
11 --formatted-device-list format ] [ --batch [= format ]] [ --batch-start
12 start ] [ --batch-count count ] [ --batch-increment increment ] [
13 --batch-double ] [ --accept-md5-only ] [ -p | --progress ] [ -n |
14 --dont-scan ] [ -T | --test ] [ -h | --help ] [ -v | --verbose ] [ -B |
15 --buffersize ] [ -V | --version ] [ device-specific-options ]
16
18 scanimage is a command-line interface to control image acquisition
19 devices such as flatbed scanners or cameras. The device is controlled
20 via command-line options. After command-line processing, scanimage
21 normally proceeds to acquire an image. The image data is written to
22 standard output in one of the PNM (portable aNyMaP) formats (PBM for
23 black-and-white images, PGM for grayscale images, and PPM for color
24 images) or in TIFF (black-and-white, grayscale or color). scanimage
25 accesses image acquisition devices through the SANE (Scanner Access Now
26 Easy) interface and can thus support any device for which there exists
27 a SANE backend (try apropos sane- to get a list of available backends).
28
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 scan 100x100 mm to the file image.tiff (-x and -y may not be
39 available with all devices):
40
41 scanimage -x 100 -y 100 --format=tiff >image.tiff
42
43 To print all available options:
44
45 scanimage -h
46
48 Parameters are separated by a blank from single-character options (e.g.
49 -d epson) and by a "=" from multi-character options (e.g.
50 --device-name=epson).
51
52 The -d or --device-name options must be followed by a SANE device-name
53 like ` epson:/dev/sg0 ' or ` hp:/dev/usbscanner0 '. A (partial) list
54 of available devices can be obtained with the --list-devices option
55 (see below). If no device-name is specified explicitly, scanimage
56 reads a device-name from the environment variable SANE_DEFAULT_DEVICE .
57 If this variable is not set, scanimage will attempt to open the first
58 available device.
59
60 The --format format option selects how image data is written to
61 standard output. format can be pnm or tiff. If --format is not used,
62 PNM is written.
63
64 The -i or --icc-profile option is used to include an ICC profile into a
65 TIFF file.
66
67 The -L or --list-devices option requests a (partial) list of devices
68 that are available. The list is not complete since some devices may be
69 available, but are not listed in any of the configuration files (which
70 are typically stored in directory /caehome/ra28145/etc/sane.d ). This
71 is particularly the case when accessing scanners through the network.
72 If a device is not listed in a configuration file, the only way to
73 access it is by its full device name. You may need to consult your
74 system administrator to find out the names of such devices.
75
76 The -f or --formatted-device-list option works similar to
77 --list-devices , but requires a format string. scanimage replaces the
78 placeholders %d %v %m %t %i with the device name, vendor name, model
79 name, scanner type and an index number respectively. The command
80
81 scanimage -f \*(lq scanner number %i device %d is a %t, model %m,
82 produced by %v \*(rq
83
84 will produce something like:
85
86 scanner number 0 device sharp:/dev/sg1 is a flatbed scanner, model
87 JX250 SCSI, produced by SHARP
88
89 The --batch* options provide the features for scanning documents using
90 document feeders. --batch [ format ] is used to specify the format of
91 the filename that each page will be written to. Each page is written
92 out to a single file. If format is not specified, the default of
93 out%d.pnm (or out%d.tif for --format tiff) will be used. format is
94 given as a printf style string with one integer parameter.
95 --batch-start start selects the page number to start naming files with.
96 If this option is not given, the counter will start at 0.
97 --batch-count count specifies the number of pages to attempt to scan.
98 If not given, scanimage will continue scanning until the scanner
99 returns a state other than OK. Not all scanners with document feeders
100 signal when the ADF is empty, use this command to work around them.
101 With --batch-increment increment you can change the amount that the
102 number in the filename is incremented by. Generally this is used when
103 you are scanning double-sided documents on a single-sided document
104 feeder. A specific command is provided to aid this: --batch-double
105 will automatically set the increment to 2. --batch-prompt will ask for
106 pressing RETURN before scanning a page. This can be used for scanning
107 multiple pages without an automatic document feeder.
108
109 The --accept-md5-only option only accepts user authorization requests
110 that support MD5 security. The SANE network daemon ( saned ) is capable
111 of doing such requests. See saned (8).
112
113 The -p or --progress option requests that scanimage prints a progress
114 counter. It shows how much image data of the current image has already
115 been received by scanimage (in percent).
116
117 The -n or --dont-scan option requests that scanimage only sets the
118 options provided by the user but doesn't actually perform a scan. This
119 option can be used to e.g. turn off the scanner's lamp (if supported by
120 the backend).
121
122 The -T or --test option requests that scanimage performs a few simple
123 sanity tests to make sure the backend works as defined by the SANE API
124 (in particular the sane_read function is exercised by this test).
125
126 The -h or --help options request help information. The information is
127 printed on standard output and in this case, no attempt will be made to
128 acquire an image.
129
130 The -v or --verbose options increase the verbosity of the operation of
131 scanimage. The option may be specified repeatedly, each time
132 increasing the verbosity level.
133
134 The -B or --buffersize option changes the input buffersize that
135 scanimage uses from default 32*1024 to 1024*1024 kbytes.
136
137 The -V or --version option requests that scanimage prints the program
138 and package name, the version number of the SANE distribution that it
139 came with and the version of the backend that it loads. Usually that's
140 the dll backend. If more information about the version numbers of the
141 backends are necessary, the DEBUG variable for the dll backend can be
142 used. Example: SANE_DEBUG_DLL=3 scanimage -L.
143
144 As you might imagine, much of the power of scanimage comes from the
145 fact that it can control any SANE backend. Thus, the exact set of
146 command-line options depends on the capabilities of the selected
147 device. To see the options for a device named dev , invoke scanimage
148 via a command-line of the form:
149
150 scanimage --help --device-name dev
151
152 The documentation for the device-specific options printed by --help is
153 best explained with a few examples:
154
155 -l 0..218mm [0]
156 Top-left x position of scan area.
157
158 The description above shows that option -l expects an option value in
159 the range from 0 to 218 mm. The value in square brackets indicates
160 that the current option value is 0 mm. Most backends provide similar
161 geometry options for top-left y position (-t), width (-x) and height of
162 scan-area (-y).
163
164 --brightness -100..100% [0]
165 Controls the brightness of the acquired image.
166
167 The description above shows that option --brightness expects an option
168 value in the range from -100 to 100 percent. The value in square
169 brackets indicates that the current option value is 0 percent.
170
171 --default-enhancements
172 Set default values for enhancement controls.
173
174 The description above shows that option --default-enhancements has no
175 option value. It should be thought of as having an immediate effect at
176 the point of the command-line at which it appears. For example, since
177 this option resets the --brightness option, the option-pair
178 --brightness 50 --default-enhancements would effectively be a no-op.
179
180 --mode Lineart|Gray|Color [Gray]
181 Selects the scan mode (e.g., lineart or color).
182
183 The description above shows that option --mode accepts an argument that
184 must be one of the strings Lineart , Gray , or Color . The value in the
185 square bracket indicates that the option is currently set to Gray . For
186 convenience, it is legal to abbreviate the string values as long as
187 they remain unique. Also, the case of the spelling doesn't matter.
188 For example, option setting --mode col is identical to "--mode Color" .
189
190 --custom-gamma[=(yes|no)] [inactive]
191 Determines whether a builtin or a custom gamma-table
192 should be used.
193
194 The description above shows that option --custom-gamma expects either
195 no option value, a "yes" string, or a "no" string. Specifying the
196 option with no value is equivalent to specifying "yes". The value in
197 square-brackets indicates that the option is not currently active.
198 That is, attempting to set the option would result in an error message.
199 The set of available options typically depends on the settings of other
200 options. For example, the --custom-gamma table might be active only
201 when a grayscale or color scan-mode has been requested.
202
203 Note that the --help option is processed only after all other options
204 have been processed. This makes it possible to see the option settings
205 for a particular mode by specifying the appropriate mode-options along
206 with the --help option. For example, the command-line:
207
208 scanimage --help --mode color
209
210 would print the option settings that are in effect when the color-mode
211 is selected.
212
213 --gamma-table 0..255,...
214 Gamma-correction table. In color mode this option
215 equally affects the red, green, and blue channels
216 simultaneously (i.e., it is an intensity gamma table).
217
218 The description above shows that option --gamma-table expects zero or
219 more values in the range 0 to 255. For example, a legal value for this
220 option would be "3,4,5,6,7,8,9,10,11,12". Since it's cumbersome to
221 specify long vectors in this form, the same can be expressed by the
222 abbreviated form "[0]3-[9]12". What this means is that the first
223 vector element is set to 3, the 9-th element is set to 12 and the
224 values in between are interpolated linearly. Of course, it is possible
225 to specify multiple such linear segments. For example,
226 "[0]3-[2]3-[6]7,[7]10-[9]6" is equivalent to "3,3,3,4,5,6,7,10,8,6".
227 The program gamma4scanimage can be used to generate such gamma tables
228 (see gamma4scanimage (1) for details).
229
230 --filename <string> [/tmp/input.ppm]
231 The filename of the image to be loaded.
232
233 The description above is an example of an option that takes an
234 arbitrary string value (which happens to be a filename). Again, the
235 value in brackets show that the option is current set to the filename
236 /tmp/input.ppm .
237
239 SANE_DEFAULT_DEVICE
240 The default device-name.
241
243 /caehome/ra28145/etc/sane.d
244 This directory holds various configuration files. For details,
245 please refer to the manual pages listed below.
246
247 ~/.sane/pass
248 This file contains lines of the form
249
250 user:password:resource
251 scanimage uses this information to answer user authorization
252 requests automatically. The file must have 0600 permissions or
253 stricter. You should use this file in conjunction with the
254 --accept-md5-only option to avoid server-side attacks. The resource
255 may contain any character but is limited to 127 characters.
256
258 sane (7), gamma4scanimage (1), xscanimage (1), xcam(1) , xsane(1) ,
259 scanadf (1), sane-dll (5), sane-net (5), sane-"backendname" (5)
260
262 Transliterated from the C original by Jeffrey Ratcliffe.
263
265 All the bugs of scanimage and much, much more.
266
267
268
269perl v5.12.4 2010-02-22 SCANIMAGE-PERL(1)