image-compare

Image-compare:使用视觉 AI 对两张图像进行比较以识别差异、相似之处和变化。适用于设计稿与实际实现的对比、视觉回归测试或识别两个版本之间的变化。

仓库最近推送
GitHub Stars
219
Forks
38
Issues / PRs
7

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "image-compare":https://skillpi.com/zh/skills/deepskill-8f1a89e74f534d4e55e9b376de548ce96ac1dc674c5d18abbf4b62c866ea847d。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

Image-compare:使用视觉 AI 对两张图像进行比较以识别差异、相似之处和变化。适用于设计稿与实际实现的对比、视觉回归测试或识别两个版本之间的变化。

0 下载

介绍来源: third_party · TerminalSkills · 1.0.0 参考来源

SkillPi 解读

实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: image-compare
description: >-
  Compare two images visually using Vision AI to identify differences, similarities, and
  changes. Use when: comparing design mockups vs implementation, visual regression testing,
  identifying what changed between two versions.
license: MIT
compatibility: "Node.js 18+"
metadata:
  author: terminal-skills
  version: "1.0.0"
  category: design
  tags: [image-compare, visual-regression, design, testing, diff]

Image Compare

Overview

Compare two images pixel-by-pixel. Returns a diff count, mismatch percentage, and generates a diff image highlighting the differences in red.

  • Comparing an implementation screenshot against the original design
  • Spotting visual regressions between two versions of a page
  • Verifying that a UI matches a Figma export

Instructions

  1. Both images are loaded and resized to match dimensions (uses the smaller of the two)
  2. pixelmatch compares every pixel and flags differences above a configurable threshold
  3. Returns mismatch stats and writes a diff image showing changes in red

Run the comparison script:

bash <skill-path>/scripts/image-compare.sh <image1> <image2> [diff-output.png] [threshold]

Arguments:

  • image1 — First image path (required)
  • image2 — Second image path (required)
  • diff-output.png — Path to write the diff image (optional, defaults to ./diff.png)
  • threshold — Pixel matching threshold 0-1, lower is stricter (optional, defaults to 0.1)

The script outputs JSON with comparison results:

{
  "totalPixels": 921600,
  "differentPixels": 4523,
  "mismatchPercentage": 0.49,
  "dimensions": { "width": 1280, "height": 720 },
  "diffImage": "./diff.png",
  "threshold": 0.1
}

Interpret the mismatch percentage:

  • < 0.1% — Essentially identical
  • 0.1% - 1% — Minor differences, likely anti-aliasing or sub-pixel rendering
  • 1% - 5% — Noticeable differences, worth reviewing
  • > 5% — Significant visual changes

Examples

Example 1: Compare a Figma design against the implemented page

bash <skill-path>/scripts/image-compare.sh design.png screenshot.png

Output:

Comparison: design.png vs screenshot.png

Mismatch: 0.49% (4,523 pixels out of 921,600)
Diff image saved to: ./diff.png

The images are nearly identical. Differences are highlighted in red in the diff image.

Example 2: Visual regression test with strict threshold

bash <skill-path>/scripts/image-compare.sh before.png after.png ./changes.png 0.05

Using a stricter threshold of 0.05 catches even subtle rendering differences between deployments. The diff image at ./changes.png highlights all detected changes in red.

Guidelines

  • The script automatically resizes both images to the smaller dimensions. For best results, use images of the same size.
  • If you see too many false positives, increase the threshold (e.g., 0.2). Anti-aliasing differences are common between browsers.
  • For CI/CD visual regression, set a mismatch threshold (e.g., fail if > 1%) and compare screenshots taken with the same viewport size.

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值75/100

亮点

  • 提供图像视觉比较功能,适用于设计稿对比、视觉回归测试等工程场景
  • 具有明确的实用价值和广泛受众
触发精准85/100

亮点

  • 触发描述清晰覆盖设计稿对比、视觉回归测试等核心场景
  • 边界定义明确,不易误触
结构规范90/100

待提升项

  • 缺少显式 When to Use 章节 原报告严重程度:轻微

    文档未设置显式的 When to Use 章节,但 frontmatter 的 description 已覆盖使用场景

    改进建议:建议在正文中添加显式的 When to Use 章节以提升可读性

亮点

  • 文档结构完整,包含清晰的执行步骤和端到端示例
  • frontmatter 信息完整,参数说明详尽
执行可靠70/100

待提升项

  • 异常处理覆盖不足 原报告严重程度:轻微

    脚本未显式处理文件不存在、图像格式错误等常见异常情况

    改进建议:建议在脚本中添加基本的文件存在性检查和错误处理逻辑

亮点

  • 调用方式明确,参数有默认值处理
  • 输出格式标准化,便于程序解析
证据可验 (前四项均值)80/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。