Linux Format

Scanning made easy

Nick Peers reveals the best way to set up, troublesho­ot and use your scanner to its fullest in Ubuntu 18.04.

- Nick Peers is grateful to his neighbour Joff for lending him a scanner that works in Ubuntu.

Nick Peers is certainly Sane as he reveals how easy it is to set up, troublesho­ot and use your scanner under Ubuntu 18.04.

Sadly, if there’s one piece of hardware that Linux hasn’t yet quite got the hang of, it’s scanners. Sure, the SANE back-end – SANE as in Scanner Access Now Easy – performs beautifull­y when it works, but it’s the working bit that’s so frustratin­g. If your scanner is supported directly by SANE itself then all is usually fine, but introduce thirdparty drivers and things can get a lot trickier.

Which is where we come in… In this tutorial we’ll look at getting your scanner working in SANE, revealing a selection of troublesho­oting tips to try should things not pan out as planned. Once that’s installed, we’ll take you on a practical guide to making use of your scanner using free software to transform your photos and documents into digital files, complete with tips and tricks for getting the best results.

Getting started

The SANE backend is baked into most flavours of Linux, including Ubuntu and its derivative­s; we’re using Ubuntu 18.04 LTS as the focus of this tutorial. Start by taking a trip to www.sane-project.org and click ‘Supported devices’ to see if your scanner is on the list. If it’s listed as anything but unsupporte­d, fire up the

Simple Scan applicatio­n that’s also preinstall­ed with Ubuntu. If your scanner is detected, you’re good to go – jump to the next section.

Things are rarely that simple, however, so don’t panic if it doesn’t show up. First, you need to verify the scanner has been detected by Ubuntu itself – open a Terminal window and enter the following command:

$ lsusb

You should see a list of Usb-connected devices, with your scanner’s manufactur­er listed among them. Assuming this is the case, try the following command:

$ sane-find-scanner

This may or may not detect your scanner, but it’s likely several USB devices will be inaccessib­le for permission­s reasons, so try this:

$ sudo sane-find-scanner

If your scanner is now detected, try the following:

$ scanimage -L

No luck? Try sudo scanimage -L and if that works, you may need to run Simple Scan (or indeed any other scanner software) using sudo from the Terminal – sudo simple-scan for example. In this event, a permission­s issue is the cause of your problem. You may be able to temporaril­y resolve it with the following: $ sudo chmod u+w /dev/bus/usb/001/002

Replace 001 with your scanner’s Bus number, and 002 with its Device number as revealed with the lsusb

command. This should allow you to use your scanner without invoking sudo permission­s, but will only work until you reboot.

Third-party drivers

If your model is listed as ‘Unsupporte­d’ on the SANE project page, don’t panic. It should reference support for another source – such as ‘epkowa backend plus

non-free interprete­r’ in the case of selected Epson scanners such as our test Perfection V370 Photo. Even if your scanner isn’t listed at all – as our Dell B1265dnf multi-function device wasn’t – don’t give up just yet.

Start your search for a suitable driver with a trip to your scanner manufactur­er’s website to see if Linux drivers are provided and easily accessible. If they are, follow the instructio­ns to download and install these – in most cases, they’ll come with an install.sh script, which you’ll need to run from the Terminal following the step-by-step guide (over the page). If not, Google your scanner make and model plus ‘Linux’ for results.

In an ideal world that should be it: opening Simple

Scan should now work, but if it still comes up blank or you’re told you need to install additional software for your scanner, it means the drivers haven’t been installed properly. Changes to later versions of Ubuntu have introduced compatibil­ity issues with SANE – the troublesho­oting box reveals more along, with a specific workaround for Epson scanners.

A Simple Scan

Once everything’s working correctly, you’re ready to start making the most of your scanner. As we said, Ubuntu ships with a built-in tool called Simple Scan, so let’s start with this. Open it and wait for a short time until your scanner model is listed – this means it’s working and ready to go. You’ll see the big green scan button; place a photo on your scanner’s flatbed and click Scan, and in a short while the image will appear in the main window.

The entire scan area will be scanned and once complete you’ll see a few controls appear at the bottom of the main window. Use the rotate buttons to flip the image if necessary, then click the scissors button to switch to crop mode, enabling you to reposition and size the selection square to surround the part of the scan you wish to keep.

Once done, click the save button at the top of the program window next to the hamburger icon. You have a choice of four formats: PDF (best for documents), JPEG, PNG and WEBP (for images). Choose PNG for maximum quality, or JPEG to share it online. Click the menu button and you’ll also see an option to email your scan; this inserts it as a file attachment (or attachment­s if it’s a multi-page scan) in JPEG format.

Once done, click Start Again to move onto your next scan – you’ll be prompted to save your scan if you’ve not already done so.

Multi-page scans

Despite its name, that’s not all Simple Scan can do: click the down arrow next to the Scan button and you’ll see options for scanning text (basically black and white) as well as photos (full colour). Simple Scan also supports multi-page scanning, either through an automatic document feeder or the Multiple Pages From Flatbed option. Choose the latter after placing the first page on the scanner. Once it’s finished, you’ll have around 10 seconds to swap the page for a new one before Simple Scan carries on. This continues in perpetuity until you click Stop.

The pages are displayed in a single row; to change their running order, choose Reorder Pages, which gives you four options: Combine Pages, Combine Pages (Reverse), Reverse, and Keep Unchanged. Single pages can be reordered directly from the scan window – simply right-click a page and choose Move Left or Move Right as required. You’ll also see options for rotating and cropping that individual page, plus copying it to the clipboard or deleting it if required.

Other tweaks can be performed via the Preference­s dialogue, accessible under the “hamburger” menu. This is split into two tabs: Scanning enables you to switch between scanners and configure various page-related options – including adjusting the delay when using the Multiple Pages From Flatbed setting. In Quality, you can set the correct resolution and tweak brightness and contrast settings for over- or underexpos­ed images. These are rather crude tools for performing correction­s, but good enough for minor adjustment­s.

Alternativ­e applicatio­ns

If you’re a seasoned scanner, or have photos to scan that require more options than those supplied by

Simple Scan, there are several alternativ­es available. If you installed a third-party driver you may find your scanner manufactur­er supplied its own scanning app –

Image Scan in the case of Epson scanners, for example. One of the advantages of more powerful alternativ­es is that they provide a preview function, as well as on-screen options that can be combined to let you change scan settings while getting a rough idea of how those adjustment­s will affect the scanned image before you commit to a full scan. They also offer a wider array of adjustment­s that can be used to correct minor problems such as colour, lighting or the effects of dust, speckles and other so-called ‘noise’.

Image Scan provides a two-paned window, with a zoomable preview in the left pane and a series of controls split into three tabs (Document, Image Controls, Tone Correction) on the right. It’s also capable of turning your scanner into a photocopie­r if your printer supports it: select Printer under Destinatio­n before clicking Scan. It also supports other Epson-specific features such as scanning negatives.

If your manufactur­er doesn’t provide an alternativ­e, but you’d like a more powerful alternativ­e, start by looking at Skanlite, available through the Ubuntu Software Store. Like Simple Scan it’ll work with any scanner recognised by SANE, but offers a preview window like Image Scan. It also provides numerous correction tools to fix problems with lighting and colour.

Skanlite is somewhat let down by the fact the preview doesn’t update in real-time – whenever you tweak the settings, you need to generate a fresh preview to see how they’ll affect your image before scanning. If you can live with this limitation, however, there’s plenty to recommend installing Skanlite along with your other scanning tools to see if it fills in any gaps, so to speak.

Introducin­g… Xsane

At the opposite end of the spectrum to Simple Scan is Xsane, which is available both as a standalone applicatio­n through the Software Centre and a plug-in for the GIMP image editor (once installed, you can access it via GIMP’S File > Create menu). Xsane is not for the faint of heart. As the annotation (see p66) reveals, it’s split into separate windows, which can be shown or hidden via the Window menu from the main screen. It can look a bit bewilderin­g as first, but start by setting things up in the main Xsane window as outlined in the annotation. Choose a destinatio­n for your scan and select a specific file type – Xsane offers a wider choice than Simple Scan, but again we’d recommend PNG for locally stored copies, JPEG for images you plan to share over the internet and PDF for general documents.

Click the Colour drop-down menu to choose Grey for old black and white photos, or Binary for text documents. Leave ‘Full Color Range’ selected unless you’re scanning slides or negatives. Beneath this are the horizontal and vertical resolution settings in dpi – the 100 figure is too low, so check out the ‘Scan at the right resolution’ box on the left for some handy tips.

You’re now ready to create a preview to guide any further pre-scan adjustment­s. Select Window > Show Preview if necessary, and then click Acquire Preview. If the preview comes out upside down or on its side, use the rotate button underneath the main window to rotate 90 degrees in any direction.

Next, click and drag around the part of your photo or document you want to scan. To constrain the aspect ratio, click the Free button beneath the preview first and choose your desired setting (normal 6x4-inch photos would be 15:10 for landscape and 10:15 for portrait, for example). Click the selection with your right mouse button to move it into the correct position if necessary.

Once you’ve done that, click the 1:1 magnifying glass button to fill the preview with your selection, then click Acquire Preview again to obtain a higher-resolution preview of the image.

Improve colour and lighting

With your selection framed, see if you can improve the image by tweaking its colour and gamma settings. Start by clicking the auto-adjust button in the main program window – it’s the third from the left. You should see an immediate improvemen­t; if you’re happy you can now

proceed to scan by clicking the appropriat­e button. If you want to go farther, there’s plenty of scope for making your own changes.

One method is to use the three dropper buttons on the preview window to manually set black, grey and white points in your image. Select each dropper in turn and then click part of the image where you see black, white or a mid-tone (grey). As you roll your mouse over part of the preview you’ll see a smaller preview window in the bottom of the preview window, showing an extreme close-up of the pixels around the selected area and thus enabling you to select more precisely. Remember, this is only a preview, so don’t worry that it looks pixelated – your final image won’t be.

If you mess things up, either click the auto-adjust button again, or click the button to its immediate right, which will reset gamma, brightness and contrast controls to their defaults.

You can also adjust levels using the histogram; look carefully at the top graph and you’ll see three sliders beneath it, representi­ng black, grey and white. Experiment with moving them along the line to see how they affect the original image. By default, the histogram shows luminance, red, green and blue colours together – the buttons at the bottom enable you to exclude them from the histogram, but they have no relationsh­ip to your tweaking, as that affects luminosity across the entire image.

If you’d like to adjust individual colours – for example, to correct a greenish hue – click the RGB default button (on the far left) on the main window to reveal separate sliders for gamma, brightness and contrast. A fair amount of experiment­ation is required here. If the extended dialogue box disappears below your screen, you’ll need to open Preference­s > Setup > Display tab and untick Main Window Size Fixed. Click OK and restart the program to allow you to convert it into a scrollable dialogue box.

Experiment­ing with the settings is all well and good, but check out the Quick Tip box on p68 for a website that can give you a leg-up on learning how to properly adjust these settings.

Batch scans

One handy feature Xsane offers is a ‘batch scan’ tool. Basically, place two or more photos on the scanning area then perform a preview. Select and prepare your first image following the advice above, and click the + button in the top-left corner of the Preview screen to add that selection to the batch scan queue.

Choose Window > Show Batch Scan to view the list. Click one to select it, enabling you to make further edits to that specific image, before clicking the + button to add it as a new entry in the batch list (you should then delete the original entry).

The Batch List window also enables you to name each specific ‘area’, rotate or flip the image and – of course – remove it from the list, which can also be saved and retrieved later. When you’re ready to scan your selected images, click Scan Batch List to scan each area in turn. Once complete, they’ll open in

Xsane’s viewer, where you’ll find additional options such as despeckle and blur filters. You can apply these to the digital image before saving it and moving on to the next item in the list.

 ??  ??
 ??  ?? The sane-findscanne­r tool helps to confirm that Linux can see your USB scanner – a major first step to fixing problems with recognisin­g it.
The sane-findscanne­r tool helps to confirm that Linux can see your USB scanner – a major first step to fixing problems with recognisin­g it.
 ??  ?? Simple Scan offers a rudimentar­y set of features, but is perfectly adequate for casual scanners or quick, uncomplica­ted scanning.
Simple Scan offers a rudimentar­y set of features, but is perfectly adequate for casual scanners or quick, uncomplica­ted scanning.
 ??  ?? Take the time to frame your target photo using Xsane’s preview window – it makes pre-scan adjustment­s easier to gauge.
Take the time to frame your target photo using Xsane’s preview window – it makes pre-scan adjustment­s easier to gauge.

Newspapers in English

Newspapers from Australia