Welcome Guest | Sign In

XSane Brings Sanity to the Mad, Mad World of Linux Scanning

By Jack M. Germain
May 19, 2010 5:00 AM PT

Using a scanner in Linux is somewhat different than using that same scanner hardware in Windows. This week's Linux Picks focuses on how the XSane scanner app handles that process.

XSane Brings Sanity to the Mad, Mad World of Linux Scanning

XSane for Linux-based OSes
XSane for Linux-based OSes
(click image to enlarge)

In the Windows world, scanner hardware is TWAIN-compatible through manufacturer-developed scanning software. By comparison, Linux Land relies on an application programming interface (API) scanning driver called "SANE." This is an acronym for Scanner Access Now Easy. SANE works in conjunction with a common graphical front-end application called "XSane Scanner."

XSane is not the only front-end GUI (Graphical User Interface) for scanning in Linux distributions. However, it is one of the most widely used scanning apps. Other scanner GUIs are XVscan, tkscan and Kooka, a popular scan application for the KDE desktop.

As the name derivation for SANE suggests, using XSane to scan documents and photos for digital storage and display, faxing and email attachments is much easier than some Linux war stories would have you believe.

Same but Different

My journey from Windows scanning proficiency to Linux-capable scanning was made with the same hardware. I used a legacy Lexmark three-in-one device (printer/scanner/fax) attached to a Windows XP box. The X1150, while it worked well as a Windows-compatible hardware device, was a dog to get working with nearly every Linux distro I tried. The root cause is credited to Lexmark hardware not being a good fit for Linux. But when there is a will, Linux provides work-arounds.

I used a generic CUPS driver for the Lexmark Z60 printer to configure the Lexmark X1150 printer and scanner. CUPS, by the way, stands for Common Unix Printing System. It is a standards-based, open source printing system of drivers that works with the Mac, Unix and Linux operating systems.

Lexmark is generally a bad choice for Linux printers since that manufacturer does not provide Linux printer drivers. Part of the Linux Lure acquired through Linux help forums, however, includes a tip to use alternative drivers to get reticent hardware working.

When installed on a Windows computer, the X1150 printer/scanner places a program icon on the desktop and in the system tray. Clicking this icon launches a scanner control application for Windows. On Linux computers, launching the XSane app loads the front-end scanning engine.

Keeping Your SANEty

Configuring the Lexmark printer/scanner hardware to talk to the Puppy Linux and Ubuntu desktop distros I use was a challenge. However, my legacy HP Photosmart 1215 printer and my newer HP Scanjet G3010 scanner configured without incident. XSane automatically recognized all three hardware devices and self-configured them.

XSane uses the SANE-library to talk to scanners. But the XSane app does not actually support any scanners itself. That is done via the SANE library. Look here to see what scanners are supported by SANE.

What It Does

Once you launch XSane, the program searches for connected scanner hardware. It will also load a pre-configured scanner profile. This process takes just a few seconds.

XSane controls a scanner and acquires images from it. Once the image is scanned, you can save it as a file in several formats such as PNG, JPG or TIF. You can save the acquired image to file, direct the image to a printer to make a photocopy, create a fax (assuming one is attached to the PC or you have a scanner/printer) or send it to an email client.

XSane also can be linked as a plug-in to GIMP, a graphic manipulation application. This lets you start XSane from within GIMP with the File > Acquire > XSane menu option.

A neat feature is the ability to save a scanned document in copy mode. XSane will automatically convert the file to PDF format. To do this, you must first install Cups-PDF. Then go to the XSane configuration with Alt+s or via preferences > setup.

XSane also has an OCR (Optical Character Recognition) engine. This gives you the added feature of editing the text in a scanned document. To edit graphical elements such as a photo on a scanned page, you first have to save the file and then edit it with a program such as GIMP.

Working the Real Estate

XSane's interface is a lot like that of GIMP. It has two or more opened windows, depending on your configuration preferences.

For example, the main window component contains the image settings, program preferences and display options. A viewer window shows the scanned image. You can resize this window and move each component anywhere on the desktop. Other display choices include standard and advanced options and a histogram.

Five viewing modes are available: viewer, save, copy, fax and email. Select the desired mode by clicking on the button next to the red bull's-eye and scrolling through the list of options.

The viewer mode simply shows the scanned image. You must manually save the image. The save mode shows the scanned image, which is already saved to a designated location. The copy mode sends the scanned image directly to a printer.

Similarly, the fax mode displays and sends the scanned image to a back-end fax application. In similar fashion, the email mode sends the scanned image to designated recipients via the resident e-mail client.

Using It

You can skip the preview mode and go directly to scanning the image by clicking the Acquire button. However, I prefer to see how the image looks before sending it along or saving it sight-unseen. A better strategy before actually scanning an image is to click the Scan button to start the preview operation.

An advantage to using the Preview mode is with it the scanned image can be adjusted and/or enhanced for color correction, contrast and brightness. You can also adjust the gamma value, brightness and contrast in the scan window before performing the scan.

XSane for Linux-based OSes
XSane for Linux-based OSes
(click image to enlarge)

If you do bypass the preview step, however, you can load the saved file into GIMP or another graphical manipulation app to edit the image. The editing tools provided in GIMP are a bit more advanced than the basic tools provided in XSane.

The saving process is a bit unconventional, even for a Linux app. You can choose the file name and image format from the drop-down menu selection. Or you can select the Save mode, enter the file name and file format, and then perform the scan.

Easy Smeazy

A popular misconception is that Linux apps are not as rigorous or as easy to use as Windows software. I have not found that to be true in most of my dealings with Puppy Linux and Ubuntu Linux. I especially find XSane to be uncomplicated.

Of course, if you are not familiar with Windows-based scanning and graphical editing software, you will be somewhat unsure of using XSane initially. However, the XSane scanner app does not have much of a learning curve, and its documentation is more complete than that of your average open source app.

Facebook Twitter LinkedIn Google+ RSS
What's your reaction to Amazon's acquisition of Whole Foods?
I'm excited -- both companies are great.
I'm worried Whole Foods will change for the worse.
I'm all for high-tech grocery ordering and drone deliveries.
This will mean more stores closing and more jobs lost.
It's the wave of the future -- you can't stop progress.
It's creepy -- I don't want Amazon taking over everything.