DSH Hub

hawkhai/win11-oneocr

dsh-win11-oneocr

BundleVision0 GitHub stars· updated 2026-08-19

Windows11 SnippingTool OCR

Install

npx @deepseek-ai/dsh plugin --profile web add github:hawkhai/win11-oneocr

Restart `dsh web` after install. Bundle APIs can change during the developer preview.

README badge

dsh-win11-oneocr DSH Hub badge
[![DSH Hub](https://dshhub.dev/badge/win11-oneocr.svg)](https://dshhub.dev/plugins/win11-oneocr)

Paste this into your README. The star count updates with every catalog sync.

From the README

Excerpt from hawkhai/win11-oneocr, cleaned of badges and images.

Windows 11 Snipping Tool OCR (OneOCR)

Offline OCR engine extracted from the Windows 11 Snipping Tool, with full-featured C++ CLI, reusable DLL wrapper, and Python visualization.

Based on: https://b1tg.github.io/post/win11-oneocr/

DeepSeek Harness plugin

This repository can be installed as a DeepSeek Harness plugin:

dsh plugin add github:hawkhai/win11-oneocr

It registers oneocr_recognize, a model-facing tool that accepts a local image path and returns recognized text together with OneOCR's structured line/word polygons, confidence values, image angle, and handwriting style. The tool runs locally on Windows 11; image bytes are not sent to an external OCR service.

The bundle defaults to the prebuilt bin/ocr.exe and its adjacent runtime files. Override ocrBin, timeoutMs, or maxOutputBytes in the plugin row if needed.

Features

FeatureDescription
8-point Bounding Box4-corner polygon bbox for lines and words (not just axis-aligned rect)
Word ConfidencePer-word recognition confidence score (0.0–1.0)
Image AngleDetected rotation angle of the text in the image
Line StyleHandwritten vs. printed text classification with confidence
Resize ResolutionConfigurable max internal resize before OCR (performance/accuracy trade-off)
Resource ReleaseProper cleanup via ReleaseOcrResult, ReleaseOcrPipeline, etc.
Unicode PathFull Unicode file path support via _wfopen in the DLL wrapper
Multi-image BatchProcess multiple images in one invocation
Plain Text Output--text mode for pipe-friendly output (no JSON)
Raw Buffer OCRocrImageRaw() for in-memory BGRA pixel buffers (no file I/O)
VisualizationPython script with confidence-colored word boxes and style labels

Prerequisites

  • Windows 11 (tested on 23H2+)
  • Snipping Tool 11.2409.25.0+

Copy these 3 files from the Snipping Tool installation folder into the same directory as ocr.exe:

  • oneocr.dll
  • oneocr.onemodel
  • onnxruntime.dll

Find the Snipping Tool folder:

Get-AppxPackage Microsoft.ScreenSketch | Select-Object -ExpandProperty InstallLocation

Example: C:\Program Files\WindowsApps\Microsoft.ScreenSketch_11.2409.25.0_x64__8wekyb3d8bbwe\SnippingTool

CLI Usage (ocr.exe)

ocr.exe <image1.png> [image2.jpg ...] [options]

Options

OptionDescription
--text, -tOutput plain text only (no JSON)
--output, -o <file>Write JSON to specified file (default: <image>.json)
--max-lines <n>Max recognition lines, 1–1000 (default 1000)
--resize <WxH>Max internal resize resolution (e.g. 1152x768)
--quiet, -qSuppress progress messages
--help, -hShow help

Examples

# Single image → JSON
ocr.exe screenshot.png

# Plain text output (pipe to file)
ocr.exe screenshot.png --text > result.txt

# Batch process
ocr.exe img1.png img2.jpg img3.bmp

# Custom options
ocr.exe photo.jpg --max-lines 50 --resize 800x600 -o result.json

JSON Output Format

Related plugins