Visual comparison tool for SuperDoc document rendering. Compares how SuperDoc renders .docx files against Microsoft Word's output.
This tool only works on macOS with Microsoft Word installed.
| Requirement | Why |
|---|---|
| macOS | Uses AppleScript to automate Word |
| Microsoft Word | Generates the "ground truth" PDF renders |
| Node.js / npm | Installs and runs SuperDoc |
| pnpm | Only needed if using a local SuperDoc repo |
This installs a small wrapper with a bundled macOS binary (Apple Silicon only):
npm install -g @superdoc-dev/visual-benchmarksRequires Python 3.10+ and uv (Python package manager).
git clone https://github.com/superdoc-dev/superdoc-visual-benchmarks.git
cd superdoc-visual-benchmarks
uv sync
uv run superdoc-benchmarkGitHub Releases are notes-only; install via npm or from source.
On first use:
- macOS will ask for permission to control Microsoft Word - click "OK" to allow
- Playwright browser will be downloaded automatically (~150MB, one-time)
If Playwright download fails, install manually:
npx playwright install chromiumNote: If running from source, prefix commands with
uv run(e.g.,uv run superdoc-benchmark).
Run with no arguments for the interactive menu:
superdoc-benchmarkFor scripting and automation:
# Check tool version
superdoc-benchmark --version
# Capture Word visuals
superdoc-benchmark word ./path/to/docs/
superdoc-benchmark word ./document.docx --dpi 200 --force
# Compare Word vs SuperDoc
superdoc-benchmark compare ./path/to/docs/
# Manage SuperDoc version
superdoc-benchmark version # show current
superdoc-benchmark version set latest # install latest from npm
superdoc-benchmark version set next # install next (pre-release) from npm
superdoc-benchmark version set 1.0.0 # install specific version
superdoc-benchmark version set --local /path/to/repo # use local repo (requires pnpm)
# Clean up
superdoc-benchmark uninstall # remove all cached dataAll outputs are saved to the reports/ directory:
reports/
├── word-captures/<document>/
│ ├── <document>.pdf # PDF exported from Word
│ └── page_0001.png ... # Rasterized pages
├── superdoc-captures/<document>-<version>/
│ └── page_0001.png ... # Screenshots from SuperDoc
└── comparisons/<document>/
├── comparison-<version>.pdf # Side-by-side: Word | SuperDoc
├── diff-<version>.pdf # Diff overlay: Word | colored differences
└── score-<version>.json # Similarity scores
Each page is compared pixel-by-pixel between Word and SuperDoc renders. The score (0-100) is a weighted combination of:
| Metric | Weight | What it measures |
|---|---|---|
| SSIM | 40% | Structural similarity (layout, shapes) |
| Ink Match | 20% | Whether text/graphics appear in the same places |
| Edge Match | 15% | Whether lines and boundaries align |
| Color Match | 15% | Whether colors are accurate |
| Blob Penalty | 10% | Penalizes large missing or extra content |
Before scoring, images are automatically aligned to handle minor position differences. The tool also detects "single issue" pages where only vertical spacing differs (common with fonts) and adjusts scoring accordingly.
Overall document score = 70% average + 30% worst page (so one bad page hurts but doesn't ruin everything).
| What | Location |
|---|---|
| Config | ~/.superdoc-benchmark/config.json |
| SuperDoc workspace | ~/.superdoc-benchmark/workspace/ |
| Playwright browsers | ~/Library/Caches/ms-playwright/ |
uv sync
uv run superdoc-benchmarkBuild binary:
uv run pyinstaller superdoc-benchmark.spec
# Output: dist/superdoc-benchmarkAGPL-3.0-only. See LICENSE.