Xspoonai official screenshot diff

From jiayaoqijia/cryptoskill · View interactive version

Xspoonai official screenshot diff is an AI agent skill from the GitHub repository jiayaoqijia/cryptoskill. Compute simple pixel diffs between two images. Useful for visual regression testing and screenshot comparison in automation workflows.

How to use this skill

Skill file

Description

Compute simple pixel diffs between two images. Useful for visual regression testing and screenshot comparison in automation workflows.

Inputs

{
  "image1": "Path or base64 of first image",
  "image2": "Path or base64 of second image",
  "threshold": "Pixel difference threshold"
}

Outputs

{
  "ok": true,
  "data": {
    "diff_percentage": "5.2%",
    "changed_pixels": 1250,
    "identical": false
  }
}

Usage

Demo Mode

python scripts/main.py --demo

Compare Images

echo '{"image1":"before.png","image2":"after.png"}' | python3 scripts/main.py

Examples

Example 1: Visual Regression Test

$ echo '{"image1":"screenshot1.png","image2":"screenshot2.png"}' | python3 scripts/main.py
{
  "ok": true,
  "data": {
    "diff_percentage": "2.3%",
    "changed_pixels": 450,
    "identical": false
  }
}

Error Handling

When an error occurs, the skill returns:

{
  "ok": false,
  "error": "Error description",
  "details": {
    "image1": "File not found"
  }
}
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.