Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

An combination of Twain and SANE API

Project Description

An combination of Twain and SANE API


  • Python 2.*
  • SANE API for Linux
  • Twain Lib for Win32


  • pyScanLib() - Main Class
  • getScanners() - Return Scanner with Name
  • setScanners(scannerName)
  • setDPI(dpi)
  • setScanArea(left,top,width,height) - For scanning selected Area size in Inches
  • setPixelType(“color”) - bw (Black & White), gray and color
  • scan() - Start Scanning
  • closeScanner() - Unselect selected scanner
  • close() - Destory connected API Class

Special Function:

  • pixelToInch(pixel) - Convert Pixel(s) to Inch(es) using DPI from setDPI() or default 200
  • cmToInch(cm) - Convert Centimeter(s) to Inch(es)
  • inchTomm(inch) - Convert Inch(es) to Millimeter(s)
  • mmToInch(mm) - Convert Millimeter(s) to Inch(es)


from pyScanLib import pyScanLib

loadScanner = pyScanLib()
scanners = loadScanner.getScanners()

loadScanner.setScanArea(width=512,height=512) #(left,top,width,height)
loadScanner.setPixelType("color") #bw/gray/color

PIL = loadScanner.scan()"scanImage.jpg")
loadScanner.closeScanner() # unselect selected scanner in setScanners()
loadScanner.close() # Destory whole class

Detail Example:

Check in repo


  • Not tested on Linux however work perfect on Windows.

Used in:


pyScanLib uses BSD 2-Clause License.

Release History

Release History

This version
History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date (5.2 kB) Copy SHA256 Checksum SHA256 Source Oct 24, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting