compare_screenshots
Pixel-diff two screenshots to detect visual changes. Returns percentage of differing pixels and a diff image highlighting changed regions. Use for visual-regression testing.
Instructions
Pixel-diff two screenshot files. Returns the percentage of differing pixels and writes a diff image highlighting the changed regions (path in the result). Use for visual-regression checks — capture with test_url/screenshot_session, then compare. threshold sets per-channel color tolerance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| threshold | No | Color difference threshold 0-255 (default: 10) | |
| screenshot1 | Yes | Path to first screenshot | |
| screenshot2 | Yes | Path to second screenshot |