
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
wia_scan
Advanced tools
Installation • Usage • License
A simple utility for using document scanners that support
Windows Image Acquisition (WIA)
and is easy to install. If your scanner works using Windows Fax and Scan, there is a good chance it will work with this python script.
This package allows you to create your own efficient scanning loop or use the one the one already provided.
Use cases:
The utility supports a simple calibration process which is fully visual. The reason for this process is that my scanner's default brightness (corresponding to brightness=0) is too bright.
Alternatives: Existing WIA libraries, but to my surprise the ones I found required quite old versions of Python, which I didn't want since I wanted to combine the scanning process with some modern Python packages.
Requirements:
wia_scan can be installed from the package repository by running
pip install wia_scan
Download the source code in this repository and install flit using pip install flit and run the following command from the source folder
flit install
The main use case of this utility is to scan many documents using a few key presses, this can be achieved by running
wia_scan many
During the process, the utility will ask you beforehand which quality profile should be used for the next scan, and multiple sides can be combined into a single picture.
wia_scan list_devices [-v]
wia_scan single [--file=<output_file>] [--dpi=<dpi>] [--brightness=<brightness>]
[--contrast=<contrast>] [--mode=<mode>] [-v] [--uid=<uid>] [-q]
wia_scan many [--out=<output_folder>] [--brightness=<brightness>] [--contrast=<contrast>] [-v]
wia_scan calibrate brightness [--start=<start_range>] [--end=<end_range>]
[--num_runs=<num_runs>] [--out=<output_folder>] [--uid=<uid>] [-q]
wia_scan --help
wia_scan --version
Options:
-h --help Show this screen.
--version Show version.
-v --verbose Verbose output
-q --quiet Quiet=no output
--dpi=<dpi> Dots per inch; the higher this setting the higher the
output resolution [default: 200]
--brightness=<brightness> Brightness setting for the scanner, goes from -1000 to
1000 [default: 0]
--contrast=<contrast> Contrast setting for the scanner, goes from -1000
to 1000 [default: 0]
--mode=<mode> RGB for colored, L for grayscale [default: RGB]
--file=<output_file> Image output file
--out=<output_folder> Scanned images output folder [default: .]
--start=<start_range> Lowest value of brightness scanned [default: -200]
--end=<end_range> Highest value of brightness scanned [default: 200]
--num_runs=<num_runs> Number of scans for the "calibration" process [default: 9]
Example: Create your own python file custom_loop.py and scan many single sided documents from the same scanner while waiting for a single key press between scans:
from wia_scan import *
device = prompt_choose_device_and_connect()
for i in range(1000000):
press_any_key_to_continue()
pillow_image = scan_side(device=device)
filename = f'{i}.jpeg'
pillow_image.save(filename, subsampling=0, optimize=True,
progressive=True, quality=80)
wia_scan is distributed under the terms of the MIT license.
FAQs
wia_scan 0.8.0
We found that wia_scan demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.