Document Scanner — TWAIN, WIA, ISIS or SANE
Document scanning functionality is a critical component for a software developer building a website, content management system, or office automation system. There are several different scanning drivers in the market:
Naturally, you may be confused as to what is the best solution for you. TWAIN, WIA, ISIS and SANE, are all scanning drivers that support acquiring physical images from scanners and storing the digital images on a computer. Although they are trying to achieve the same task basically, a popularity search shows that TWAIN is leading the game.
These four document scanning drivers have some different scanner functionalities and compatibilities, which makes them suitable for different situations. Let’s take a look at them one by one.
What is TWAIN Scanning
TWAIN is scanning protocol that was initially used for Microsoft Windows and Apple Macintosh operating systems, and it added Linux/Unix support since version 2.0. The first release was in 1992. It was designed as an interface between image processing software and scanners or digital cameras.
Where do I get a TWAIN compatible scanner?
TWAIN is the most commonly used protocol and the standard in document scanners. Especially, these scanner vendors are members of the TWAIN working group: Fujitsu Computer Products of America, Kodak Alaris, Epson America, HP, and Visioneer.
Here is a list of TWAIN certified drivers: http://resource.twain.org/twain-certified-drivers/
In most cases, users should be able to either get a free TWAIN driver or easily find one (from the manufacturer’s website).
The software has three key elements:
- The Application
- The Source Manager
- The Data Source
The Source Manager Interface provided by TWAIN allows your application to control data sources, such as scanners and digital cameras, and acquire images, as shown in the figure below.
Although nearly all scanners contain a TWAIN driver that complies with the TWAIN standard, the implementation of each TWAIN scanner driver may vary slightly in terms of scanner setting dialog, custom capabilities, and other features. It’s good if you want to use features specific to a particular scanner model, but if you want your application’s scanning behavior to be consistent on different scanners, you need to be wary of customized code.
The TWAIN standard is now evolving to the next generation, called TWAIN direct. The TWAIN working group, that Dynamsoft is an associate of, claims that with TWAIN direct vendor specific drivers will no longer be needed. The application will be able to communicate directly with scanning devices. The best of TWAIN direct is still to come.
What is WIA
WIA (Windows Image Acquisition), introduced by Microsoft since Window Me, is the driver platform delivered with the Windows OS, including Windows 7, Windows 8, etc. It enables applications to acquire images from all kinds of digital cameras and scanners. It sounds very similar to TWAIN, doesn’t it?
Both TWAIN and WIA can work with scanners and cameras as long as the driver is installed. Generally, if your application is going to interact with scanners most of the time, especially if old scanners need to be supported, TWAIN is recommended. For cameras, WIA offers better support. But, sometimes TWAIN based applications can communicate with WIA devices, such as scanners or cameras, via the “TWAIN compatibility layer”.
There are other differences between TWAIN and WIA. TWAIN has three transfer modes (native, memory, file) while WIA has only two (memory, file). TWAIN enables device vendors to create a customized user interface for each driver. WIA uses a simplified user interface for all devices, based on a scripting object model. If you only need basic scanning functions, WIA is enough. If you need to use more sophisticated features of a scanner, such as different options for each page when scanning in duplex mode, TWAIN should be your choice.
What is ISIS
Unlike TWAIN, produced by a non-profit organization, ISIS doesn’t come for free. Scanner vendors need to pay a royalty fee in order to use the ISIS driver. Although ISIS was originally targeted for a production environment (higher volumes, supporting advanced features of high-end scanners), the high cost is driving vendors away. As a result, ISIS is not popular in enterprises.
Moreover, despite ISIS’s reputation in performance, many developers also claimed that no obvious technical advantage is identified when comparing ISIS to TWAIN.
What is SANE
SANE (Scanner Access Now Easy) is an application programming interface (API) commonly used in UNIX (including GNU/Linux).
SANE is an open source project. You can download its source code (latest version 1.0.24) at http://www.sane-project.org/source.html.
Unlike TWAIN, SANE separates the user-interface (front-end) from the driver of a device (backend). The SANE driver only provides a backend interface, with the hardware and the use of a number of “options” to drive each scan. One example of an option to define the scan area is as below,
This separated implementation makes SANE perfectly suitable for a network scanning scenario, where you have all computers connected in a LAN and the scanners connected to only one or two computers as shared scanners. Also, without tying with a specific GUI, as TWAIN does with Win32 or the Mac API, SANE is easier to implement a command-line driven interface. On the other hand, SANE does have some GUIs, like XSane, phpSANE etc., that you can use if needed. Or, you can customize one GUI specifically for one scanner.
So now have you got an idea and made up your mind? Below is a comparison table for these 4 drivers that summarizes what was mentioned above.
|Digital camera support||★★★★||★★★★★||★★||★|
|OS support||Windows, Mac OS, Linux/Unix||Windows||Windows||Linux/Unix|
|Scanner Market Share||★★★★★||★★★★||★★||★★|
|Application Market Share||★★★★★||★★★★||★★||★★|
|Price||Free||Free||Expensive||Free (Open Source)|
TWAIN drivers are superior for most cases since it provides the maximum compatibility with scanners and also the freedom to customize the scanning based on the scanner model. If you’re building a simple scanning application, WIA might be suitable as well.
ISIS may only be suitable given a specific requirement. SANE provides optimal support across network scanning and for systems where there is no Windows system.
If you are interested in a document scanning SDK, you can take a look at the SDKs we provide:
- Dynamic .NET TWAIN (.NET TWAIN SDK, for desktop-based applications)