What is TWAIN

May 29
09:39

2015

Adrian Cobb

Adrian Cobb

  • Share this article on Facebook
  • Share this article on Twitter
  • Share this article on Linkedin

This acticle gives a brief introduction about TWAIN scanning protocol.

mediaimage
Introduction

What is TWAIN?

Is it Technology Without An Interesting Name? Come on,What is TWAIN Articles you know that’s just a backronym joke According to the definition from Wikipedia, TWAIN is:

… an applications programming interface (API) and communications protocol that regulates communication between software and digital imaging devices, such as image scanners and digital cameras.en.wikipedia.org/wiki/TWAIN

Basically, TWAIN is a scanning protocol connecting scanners and applications on personal computers. By providing standard interface, TWAIN allows applications to acquire images from TWAIN compliant devices (scanners, digital cameras, etc.)

 TWAIN Architecture

TWAIN communication consists of three parts: the application, the Source Manager, and the Source.

Or, take a closer look:

  • Application Layer: User’s applications, including user interface;
  • Protocol Layer: Turn user’s request into something TWAIN can understand;
  • Acquisition Layer: Forward the request further to hardware device;
  • Device Layer: Data source.

In order to get images from the Device Layer, Application need to talk with Source Manager, as shown from the above diagram. To communicate with Source Manager, Application can use API hook DSM_Entry() provided by TWAIN. And Source Manager will call DS_Entry() to talk to Source. All TWAIN’s operation, such as resolution changes, color adjustment, is based on these two function calls DSM_Entry() and DS_Entry().

TWAIN is supported on Macintosh OS as well as Microsoft Windows. In Windows system, TWAIN Source Manager is in the form of a DLL, delivered with other Windows system files.  For 32-bit systems, it is TWAIN_32.DLL, and for 64-bit systems, it is TWAINDSM.DLL .

Conclusion

I hope this post can help you with a general understanding about TWAIN scanning protocol. If you need any specific information, please just let me know via comment or email.

P.S. For sure, besides TWAIN, there are some other scanning protocols available in the market. You can check it out at Document Scanning: TWAIN, WIA, ISIS or SANE?

Categories: