PyinsanePython扫描仪操作库

联合创作 · 2023-09-29

Pyinsane 是 Sane API (使用ctypes) 和抽象层的纯 Python 实现。支持 Python 2.7 和 3.x,要求 Pillow 和 libsane 支持。

实现简单扫描的代码:

device.options['resolution'].value = 300
# Beware: Some scanner have "Lineart" or "Gray" as default mode
device.options['mode'].value = 'Color'
scan_instance = device.scan(multiple=False)
try:
    while True:
        scan_instance.read()
except EOFError:
    pass
image = scan_instance.get_img()
浏览 1
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报