Basic Scanning with XSane



 

 


Scanning photos and documents is a frequent requirement for many people. Linux has the XSane tool to provide this capability. XSane is the graphical front-end for SANE which stands for Scanner Access Now Easy.

Open XSane with the KDE Menu => Applications=>Graphics=>Scanner Tool. This will launch XSane which searches for scanners that are connected to your computer. XSane found my USB connected HP5610 All-in-one device without difficulty.

Main Window

The main window of XSane provides a number of controls which can be used to manage the parameters of the scan, such as the resolution, color balance, and others. You should seldom need to make adjustments to many of these controls unless you have some special requirements. In many cases the image can be manipulated after the scan is made by software such as GIMP, which is very powerful and flexible, or Gwenview which is image viewing and management software. Gwenview is much less complex than GIMP but offers some basic functionality such as red-eye reduction, cropping and sizing.

Figure 1: The main window of XSane allows you to select the scan resolution, color vs greyscale, and other options. You also initiate the scan from here.

Figure 1: The main window of XSane allows you to select the scan resolution, color vs greyscale, and other options. You also initiate the scan from here.

The things you may need or want to change most often are the file type and the resolution.

Selecting the File Type

XSane supports multiple file types and you should generally select on of these for the best results depending upon the intended use for the scanned image. XSane supports the JPEG, PDF, PNG, PNM, Postscript, TEXT and TIFF image formats. For the gory details of each image format type follow the respective links.

JPEG is usually a good choice for images. This format is a bit lossy but generates relatively small files with decent resolution. A JPEG file may have some image anomalies around sharp transitions such as lines and edges so is not good for text or line art.

I like the PNG format for lossless scans such as archival photographs, line art and text scans. This preserves the original image as well as possible. This is also a very common, open format with no license issues.

The TEXT format would be used for scanning text documents that you intend to convert to text using the Optical Character Recognition (OCR) program built into XSane. This is a fast way of getting hard copy documents into soft copy, but it is not always accurate and can require some work to correct the OCR errors.

Setting the Resolution

The resolution of the scanned image determines the amount of detail you can see and how large you can blow up the final image effectively. A resolution that is too high for your requirements can take up valuable disk space, while a resolution that is too low can result in a grainy image that does not contain enough detail.

An 8.5″x11″ document scanned at 1200 Dots Per Inch (DPI), a very high resolution, will create a file of almost 400MB. The same document scanned at 300DPI results in a file of about 25MB. Note that the text box immediately to the left of the Scan button on the main XSane window shows the size of the image in the selected units (inches or cm) and the size of the file that will be created.

I recommend a resolution of 300DPI for most common scanning. For archiving photographic images you should choose a higher resolution consistent with the amount of space available on your media, such as your hard drive, CD or DVD, and the number of images you need to archive on a single disk.

Note that very large images may be rejected by many email systems. The upper limit that many ISPs allow varies but is usually no larger than 10MB. For email, lower resolution, and therefore smaller files are better.

Preview Scan

It is a good idea to do a preview scan, especially if the photo or document is any size other than standard letter (8.5×11 U.S.). This is a quick scan that displays the document in position on the glass. It allows you to select the area of the final scan with the mouse pointer so that you get only the document or portion of the document that you need.

To show the Preview window, select Menu bar => Window => Show Preview. To acquire the preview, simply click on the Acquire preview button. I have placed a standard size 4×6 photo on the scanner glass to use for this example.

Figure 2: The XSane preview window after capturing a preview of a photograph. Notice the dashed lines indicating the area of the image that I intend to capture with the final scan.

Figure 2: The XSane preview window after capturing a preview of a photograph. Notice the dashed lines indicating the area of the image that I intend to capture with the final scan.

After you have the preview, you can use the mouse pointer to select the specific area of the image to scan. If you do not select anything, the entire area of the scanner glass will be scanned, producing an image that may be much larger than you want and containing much “empty” space. The very least you should do is select the area of the document or photograph rather than scanning the entire glass.

Making the Scan

After selecting the area of the scanner glass that you want to scan, simply press the Scan button in the main XSane window. If the image is not exactly what you need, you can go back to the preview window and adjust the selected area, or you can adjust any other parameters such as the resolution, brightness, contrast or anything else, and then scan the image again.

Figure 3: The scanned photo is displayed in the Viewer window.

Figure 3: The scanned photo is displayed in the Viewer window. Note that you can click on this image to view the full-size version.

In Figure 3 I have scanned the portion of the image selected in Figure 2, above, at 300DPI using the PNG format. I would normally scan a photograph in a higher resolution if I were going to use it as an archive file, or perhaps a lower resolution for use in a web site. I used 300DPI so you can see what that looks like. The file created from this scan is about 3MB is size.

Note that higher resolution scans will take significantly more time to complete than low resolution scans.

Saving the File

When you have a scanned an image that meets your needs you can save it as a file. Simply click the diskette icon at the left of the toolbar to open the standard KDE File Manager save window. Choose a location and change the file name if you like and then click the Save button.