TWAIN is a software API and communication protocol that helps applications control scanners, digital cameras, and other image-capturing devices. Any application that includes TWAIN support can interact with any scanner with a TWAIN-compatible device driver. It has been an industry standard since the early 1990s and is supported by most operating systems, image-editing applications, and nearly every scanner and image-capture device on the market.
The TWAIN API works through a software library called a TWAIN Data Source Manager (DSM), which is included with most TWAIN device drivers. First, any application with TWAIN support can talk to a DSM to tell it which scanner it wants to use and how to set up the scan. The API includes several parameters you can customize, including image resolution, cropping, color depth, and page orientation. Once you've set everything up and initiated the scan, the app sends those parameters to the DSM, and the DSM passes them on to the scanner. The scanner captures the image and sends it back to the DSM, which processes it and forwards it back to the application that first requested the scan.
A new extension of TWAIN, called TWAIN Direct, was introduced in 2019. TWAIN Direct eliminates the need for device-specific drivers by establishing direct communication between an application and a device through a network connection, like Wi-Fi or Ethernet. Since it works over a network connection, TWAIN Direct adds support for mobile operating systems like Android and iOS.
NOTE: While TWAIN looks like an acronym, it does not actually stand for anything and is capitalized as a stylistic choice. Many people have assigned a backronym, "Technology Without An Interesting Name."