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.
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.
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.
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.
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()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With