With every new version of an OS comes a bushel of surprises. Some time ago, when I installed Lion, my old Canon N670U stopped being supported. Canon was not updating the drivers anymore. Fortunately, I didn’t have anything that needed scanning.
Later, when I did, I downloaded a trial of VueScan and used that. But that was merely a trial, and the product is $40. I must be able to do better, I thought. I was aware of a set of open-source drivers called TWAIN SANE that I’d used in the past to support a Mustek scanner for which no OS X drivers had ever existed. But, at the time, there was not a version of TWAIN SANE for Mountain Lion.
Now there is. So I’m going to install it and we’ll see what happens.
First, I go to the TWAIN SANE website. The first package to be downloaded and installed is libusb. I chose the binary package, as I don’t see any need to compile from code. Installation was successful. The libraries were installed, it seems, in /usr/local/lib.
The next package is the SANE backend. This package also installs into /usr/local/lib and /usr/local/bin.
Now I need to figure out which backend supports my scanner. I go to http://www.sane-project.org/sane-mfgs.html and look up the Canon N670U. The backend is plustek.
OK, so keeping that information bookmarked for later, I test the scanner by typing, at the command line:
scanimage --format tiff > ~/test.tif
It takes a very long time for the scanner to exhibit any sign of life at all. But eventually it does scan. The second attempt goes faster, which I take as a good sign. Only a small section of the scanner’s bed is scanned, which I suppose is a neutral sign. I didn’t, after all, give it any parameters or instructions. I suppose I expected the entire bed to be scanned in the absence of those. Ah well.
The next thing to install is the SANE preference pane. After that’s finished, I fire up System Preferences and take a look. Sure enough, there’s a prefpane labeled “SANE” with the kind of godawful icon that only an open-source project can get away with.
Clicking on the godawful icon gives me a list of drivers. I find “plustek” in the list and hit the Configure button. What I see is basically a text file, with a number of configuration options. I have no earthly idea what to change, if anything. I’ll leave it alone for now.
So now what? How to actually scan anything? Back when I used TWAIN SANE before (on an earlier OS and with an earlier version of Photoshop), I could fire up Photoshop, go to File->Import, and see TWAIN SANE as an option. Not anymore.
But it pays to read the FAQ. According to the TWAIN SANE FAQ:
Default installations of recent versions of Adobe PhotoShop are not TWAIN compatible, but require a TWAIN plugin to be installed. For more information about this see Adobe tech note 405072.
So I follow the link and download a package called “Optional Plug-Ins” which contains not only the TWAIN plugin, but also some others whose function is unknown to me. The Adobe tech note, by the way, also carries this dire warning:
In Mac OS, you can use the TWAIN plug-in to scan when running Photoshop CS6 (Photoshop CS6 only runs in 64-bit mode). Not many scanner manufacturers have released 64-bit versions of their scanner drivers, so you may not be able to use TWAIN. Contact your scanner manufacturer for more information.
If your scanner manufacturer does not support scanning in 64-bit mode, or you have issues scanning with TWAIN, you can scan into Photoshop CS6 using Apple’s ImageKit technology, which is built into Photoshop CS6, does not need a plug-in to be installed, and provides access to a large number of scanners.
So maybe I’ll look into that if this doesn’t work.
At any rate, I copy the plug-in to /Applications/Adobe Photoshop CS6/Plug-ins and fire up the app. No good. Still nothing listed under Import. It’s possible that it’s the 64-bit issue mentioned on Adobe’s site.
So putting aside Photoshop for the time being, I try opening Image Capture. No sign of any scanners. The FAQ had some words to say about that as well:
Image Capture uses the TWAIN Bridge application to talk to TWAIN data sources. This is a really weird application. Firstly, it does not — like normal TWAIN capable applications — let the TWAIN data source try to find a scanner it supports by itself. Instead it requires a list of vendor and product IDs of all supported scanners to be present in the TWAIN data source’s property list (/Library/Image Capture/TWAIN Data Sources/SANE.ds/Contents/Info.plist). So the first thing to do is to check if your scanner’s IDs are in this list and if not add them. See Apple Technical Note TN2088 for details about the format of this file. If you succeed with this let me know, and I can add the numbers to the default list for the next release.
There is a link in that paragraph on the FAQ, but it goes nowhere, the Apple tech note apparently long since destroyed. And the folder listed in these instructions (/Library/Image Capture/TWAIN Data Sources/SANE.ds) doesn’t exist either.
Oops, it looks like I skipped a package. The final package to install (and the first on the list of packages on the TWAIN SANE website) is the TWAIN SANE interface itself. It installed without a hitch, but also without any indication of where. No sign of it in /Applications or /Applications/Utilities.
Aha! It’s not an app at all. Remember how I said /Library/Image Capture/TWAIN Data Sources/SANE.ds was missing? Now it exists. So I dig into the package and open up the Info.plist file.
It’s a plist all right… and without that tech note I’m not entirely sure what it’s looking for. But what the hell. I search for my scanner’s product ID (which I got from the backends list and is 0x220D) — not found.
So I add the following section, hoping that it works:
<dict> <key>device type</key> <string>scanner</string> <key>product</key> <string>0x220D</string> <key>vendor</key> <string>0x04A9</string> </dict>
Nothing seems to have happened. Image Capture and Photoshop still show nothing.
SNAC — also with a godawful icon — launched OK, but when I hit “Preview,” it thought about it for a while and returned the error “scan image:setting of option –mode failed (Invalid argument)”
That was easy enough to figure out. The manpage for scanimage shows the options are gray, lineart, and color. The preferences for SNAC called gray “grayscale” so that’s that issue figured out. That was easy to fix in SNAC’s preferences.
So now I hit “Preview” and… success! There’s a little greyscale image on the screen. I can select the relevant area, change the scan mode to Color, and hit “Scan.”
After the progress bar completes, it asks me to save my file. It saves as a TIFF file by default. I save it, and open it up in Preview… boy, that’s low-res. But I did select 50 dpi. Let’s see what it looks like at 300. I’ll also check the “Open in helper app” button to get it to load the file in Preview. That should give me more options for saving. (SNAC’s only two supported formats are TIFF and PNM.)
Image quality? Well, that’s hard to discern. I now see that the text on the card is embossed, which probably played havok with the scanner’s sensor. Wish I had some kind of known-good reference image to scan and compare. But at any rate, I got the damn thing to come to life and put an image in my computer, which is all I’m looking for at the moment.
So, is it worth it? For minimal scanning, maybe. If I did a lot of it, I might want to invest in VueScan just to gain the ability to scan into Photoshop directly. The professional version even allows ICC profiles, but I’m nowhere near sophisticated enough for that sort of thing.