Document Scanning: TWAIN, WIA, ISIS or SANE?

document scanning

You are a software developer building a website, or a content management system, or an office automation system for your customer.

During development your customer contacts you and says, “I think we need to have document scanning functionality in the system. Can we add it?”

“Sure, no problem”, you answered.

After some research about document scanning, you find out that there are several different scanning drivers used in the market: TWAIN, WIA, ISIS and SANE.

What are they all about? What are the differences between them? Which one should you choose?

A little confused? Keep reading.

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 research I did recently shows that TWAIN is leading in the game.

Don’t draw a quick conclusion though. These four scanning drivers have some different scanner functionalities and compatibilities, which makes them suitable for different situations. You need to know your needs and find the suitable one. Let’s take a look at them one by one.

Quick Links:

  1. TWAIN
  2. WIA
  3. ISIS
  4. SANE

TWAIN

TWAIN

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.

It has three key elements, the application software, the Source Manager software and the Data Source software. 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.

TWAIN elements

TWAIN elements

Nowadays TWAIN is the most commonly used protocol. Actually TWAIN is already the de facto standard in document scanners. In most cases, users should be able to either get a free TWAIN driver, or easily find one, for their scanners – Canon, HP, Epson, Kodak, Xerox, you name it.

Although nearly all scanners contain a TWAIN driver that complies with the TWAIN standard (the latest version is 2.3), the implementation of each TWAIN scanner driver may vary slightly in terms of scanner setting dialog, custom capabilities, and other features. It is 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.

If you are interested about a TWAIN scanning SDK, you can take a look at the SDKs we provide:

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.

ISIS

ISIS (Image and Scanner Interface Specification) is a proprietary scanner interface developed by Pixel Translations in 1990 (today: EMC captiva).

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.

SANE

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,

SANE options

SANE scan area “options”

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, like 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.

Conclusion

So now have you got an idea and made up your mind?

I made a comparison table for these 4 drivers as below to help you further understand (DISCLAIMER: The following comparisons are subjective.):

TWAIN

WIA

ISIS

SANE

Scanning Functionality
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)

In conclusion, I would suggest you to go with TWAIN drivers in most cases, as it provides the maximum compatibility with scanners and also the freedom to customize the scanning based on the scanner model. If you are building a simple scanning application, WIA might be suitable as well. For ISIS, unless you have a specific requirement, you’d better check other options first. SANE provides optimal support across network scanning and on systems were there is no Windows system.

So, what’s the scanning driver you are currently using?

  • http://en.dutras.org/ Leandro G Faria Corcete DUTRA

    I did not get how is that Twain & Sane are rated the same in ‘scanner support’, and Sane much lower in ‘scanner market share’.

    • Adrian

      Leandro you are right…the concept of “scanner support” is a little vague…I just removed this row, and made some updates. Thanks.

Subscribe Newsletter

Subscribe to our mailing list to get the monthly update.

Subscribename@email.com