Doing Basic Scans

Once scanimage -L has found your scanner, you probably want to begin using the scanner in a more meaningful way. Because SANE is technically an API, not a program, the manner in which you use SANE depends upon the program you use to access it. One detail you may need for some of these programs is the scanner device name. This name isn't merely the device file (in the/dev directory tree), although it includes this identifier. The device name is a concatenation of the back-end name, a colon (:), and the device filename. For instance, this name might be mustek:/dev/sg2 or umax1220u:/dev/usb/scanner0. This name is returned by scanimage -L.

Here are some popular basic scanning packages:

scanimage This program is a text-mode front-end to SANE. It accepts a large number of options (consult its man page for details), but a basic scan can be performed by typing scanimage -d device > scanfile.pnm, where device is the device name, such as mustek:/dev/sg2. The output file is in Portable Anymap (PNM) format unless you change this detail with the -format format option. Despite the fact that this program is a front-end, it's typically distributed in the SANE back-end package.

xscanimage This program is a basic GUI SANE front-end program. It does many of the same things as scanimage, but it uses GUI controls to access most options. It's usually part of a SANE front-end package (sane or sane-frontends).

XSane This program isn't part of the main SANE package, but it's closely related. It's a more feature-filled X-based front-end to SANE, headquartered at Most distributions ship it in a package called xsane.

Kooka This program is a GUI front-end to SANE that's affiliated with the K Desktop Environment (KDE). Kooka features image management and libraries to help provide Kooka-mediated scans to other KDE applications. You can learn more at

There are also more specialized SANE-based scanning applications, such as xcam (which uses SANE as a method of interfacing to cameras) and scanadf (which provides support for scanning via automatic document feeders). The upcoming section, "Network Scanning," describes another unusual use of SANE.

As an example of SANE in use, consider XSane. You can scan a document using XSane by following these steps:

1. Launch the program by typing xsane. It may respond by asking you to select which of several scanners to use. This may happen even if you have just one scanner, should the program detect the scanner using two or more redundant device files. In this case, it doesn't matter which you use. XSane should bring up four windows, as shown in Figure 3.4. In that figure, clockwise from the bottom-left corner, are the options window, the main control window, the color histogram window, and the preview window. You can open or close windows, including a couple that don't open by default, from the View menu in the main control window.

X-S - A - N E

X-S - A - N E

Figure 3.4: XSane provides several windows in which you can enter options and control a scan.

XSane starts up in Viewer mode by default. This means that if you begin a scan, the program opens another window to display the scan. You can then manipulate and save the image from the viewer window. You can select other modes from the XSane Mode option at the top of the main control window. For purposes of this demonstration, select Save. This option enables you to save the scan to a file. The main control window expands to provide a field for entering the filename and format of the file.

3. If the default out.pnm isn't a suitable filename, type a better name in the filename field, or click the icon of a floppy disk to pick a filename using a file selector dialog box.

4. Select a scan resolution in the resolution selection button in the main control window. (This button is set to 150 in Figure 3.4.) Some scanners use sliders to set the scan resolution.

5. If the document is grayscale, such as a black-and-white photograph, click the Grayscale Scan box in the options window. Some scanners may provide additional bit depth or line-art options.

6. Place the document to be scanned on the scanner's bed.

7. In the preview window, click the Acquire Preview button. Your scanner should spring into action and scan a low-resolution preview that will appear in the preview window.

8. If you don't want to scan the entire page, select the area you do want to acquire with the mouse in the preview window, much as you would in a graphics program.

9. Click the Scan button in the main control window. XSane should scan your document and save it to the file you specified in Step 3.

10. Repeat Steps 3 through 9 if you want to scan more documents, or select File O Quit to exit from the program.

You can set several additional options in XSane. For instance, you can select destinations to which to send the scan using the XSane Mode option (make a photocopy with the Copy option, fax a document with Fax, or e-mail a document with Email); you can adjust brightness, contrast, and gamma values with the sliders in the middle of the main control window; and so on. Some options apply only to specific scanners, so you may see different options than those shown in Figure 3.4.

Note With some scanners, SANE shuts off the scanner's lamp whenever you quit from a SANE front-end. Many SANE front-ends also provide a means to shut off the lamp manually, such as the Lamp Off button in the options window in Figure 3.4. Other scanners shut off their lamps only when you turn off the scanners.

0 0

Post a comment