screen_diff
Compare before and after screenshots to get an SSIM score, the share of pixels changed, and bounding boxes of changed regions. Verify that a UI change occurred and only where expected.
Instructions
Compare two screenshots or frames: returns an SSIM similarity score, the share of the image that changed, and bounding boxes of the changed areas in b's pixel coordinates, plus b inline with those areas outlined. Use it to check that a UI change happened (and only where expected).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | The 'before' image (or video: its first frame is used). | |
| b | Yes | The 'after' image (or video). Scaled to a's size if it differs. | |
| returnImage | No | Also return 'b' inline with the changed regions outlined in red (default true). | |
| pixelThreshold | No | How different (0-255 mean) a cell of about 32x32 image pixels must be to count as changed (default 12: catches a changed label or a toast). |