Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I want to connect my program to image scanner

I want to write program with python which can get input from scanner and save as jpg. I don't have any idea how to start. please help.

like image 717
Aryan Avatar asked Mar 26 '13 06:03

Aryan


People also ask

How do I connect my scanner to my computer?

Install or add a local scannerPlug the USB cable from your scanner into an available USB port on your device, and turn the scanner on. If that doesn't work, here's a way to do it manually. Select Start > Settings > Devices > Printers & scanners or use the following button. Select Add a printer or scanner.

How do I scan from Windows 10 to my printer?

Windows 10 includes a built-in scan utility, which you can access from the printer context menu. Click Start, type: devices and printer then hit Enter. Right-click your scanner or printer, then click Start Scan.


2 Answers

Six years have passed and I came here today looking for the answer to the same question.

Pysane and python-imagescanner in the currently accepted answer are unfortunately no longer active, but after som further searching I found libinsane which seems to be a better option nowadays.

like image 112
Albert Avatar answered Sep 21 '22 14:09

Albert


In Windows, the module you will want to look into is called the Python TWAIN module, while in Linux (and I think Mac) you should look into pysane.

Now that I am digging into this it looks like there is a project called python-imagescanner that tries to wrap these two approaches into a common library,

From imagescanner's documentation

Getting access to a scanner device:

 from imagescanner import ImageScanner

 # instantiate the imagescanner obj 
 iscanner = ImageScanner()

 # get all available devices
 scanners = iscanner.list_scanners()

 # choose one of the devices
 scanner = scanners[0]

 # scan your file (returns a PIL object)
 scanner.scan()
like image 45
Jason Sperske Avatar answered Sep 21 '22 14:09

Jason Sperske