verify_render
Compare rendered HTML against a Figma design PNG to measure visual fidelity. Returns SSIM, pixel-diff percentage, and clustered diff regions for fixing mismatches.
Instructions
Visual verification (MEASUREMENT ONLY): render an HTML file with headless Chromium INSIDE this server (does NOT use the user's Chrome / Control_Chrome) and compare it to the Figma design PNG. Returns SSIM (0-1, higher = closer), pixel-diff %, and clustered diff regions (bounding boxes of disagreement, in logical px). Provide the reference PNG via figmaUrl (auto-fetched), figmaPngPath, or figmaPngBase64. Use after generating HTML to objectively check fidelity, then fix only the reported regions — this tool never changes code. Requires npm install + npx playwright install chromium.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bg | No | Background [r,g,b] to flatten transparent reference-PNG pixels onto before comparing. Default [255,255,255]. For dark designs pass the real background (e.g. [13,17,23]) — otherwise transparent areas read as a false full diff. | |
| clip | No | Optional [x,y,w,h] in CSS/logical px to compare ONLY the content area. Use it to exclude dead margins / parent-canvas background that the isolated frame cannot reproduce (that noise otherwise dominates the regions and masks real content diffs). Region coords are reported back in full-frame coords. | |
| scale | No | Device scale factor for render and reference (default 2 — match render_node_png). | |
| outDir | No | Directory for the diff image (default ./verify-out). | ./verify-out |
| figmaUrl | No | Figma node URL — reference PNG fetched automatically at the given scale. | |
| htmlPath | Yes | Absolute path to the generated .html file to render. | |
| threshold | No | SSIM pass threshold (default 0.95). | |
| frameWidth | Yes | Figma frame width in CSS px (e.g. 1440 or 1920). HTML is rendered at this width. | |
| figmaPngPath | No | Alternative to figmaUrl: local path to an already-saved reference PNG. | |
| figmaPngBase64 | No | Alternative: base64 of the reference PNG. |