image-compare
二つの画像を見比べて、AIが違いや似ている点を検出し、デザイン案と実装、バージョン間の変更点などを確認し、視覚的な変化を比較検証するSkill。
📜 元の英語説明(参考)
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.
🇯🇵 日本人クリエイター向け解説
二つの画像を見比べて、AIが違いや似ている点を検出し、デザイン案と実装、バージョン間の変更点などを確認し、視覚的な変化を比較検証するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o image-compare.zip https://jpskill.com/download/15000.zip && unzip -o image-compare.zip && rm image-compare.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/15000.zip -OutFile "$d\image-compare.zip"; Expand-Archive "$d\image-compare.zip" -DestinationPath $d -Force; ri "$d\image-compare.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
image-compare.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
image-compareフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 3
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Image Compare
概要
2つの画像をピクセル単位で比較します。差分カウント、ミスマッチ率を返し、差分を赤色で強調表示した差分画像を生成します。
- 実装されたスクリーンショットと元のデザインの比較
- ページの2つのバージョン間の視覚的なリグレッションの特定
- UIがFigmaのエクスポートと一致することの検証
手順
- 両方の画像がロードされ、寸法が一致するようにリサイズされます(2つのうち小さい方を使用)。
pixelmatchはすべてのピクセルを比較し、設定可能な閾値を超える差にフラグを立てます。- ミスマッチの統計を返し、変更点を赤色で示す差分画像を書き出します。
比較スクリプトを実行します。
bash <skill-path>/scripts/image-compare.sh <image1> <image2> [diff-output.png] [threshold]
引数:
image1— 最初の画像のパス (必須)image2— 2番目の画像のパス (必須)diff-output.png— 差分画像を書き出すパス (オプション、デフォルトは./diff.png)threshold— ピクセルマッチングの閾値 0-1、小さいほど厳密 (オプション、デフォルトは0.1)
スクリプトは、比較結果を含むJSONを出力します。
{
"totalPixels": 921600,
"differentPixels": 4523,
"mismatchPercentage": 0.49,
"dimensions": { "width": 1280, "height": 720 },
"diffImage": "./diff.png",
"threshold": 0.1
}
ミスマッチ率の解釈:
- < 0.1% — 実質的に同一
- 0.1% - 1% — わずかな違い、おそらくアンチエイリアスまたはサブピクセルレンダリング
- 1% - 5% — 目に見える違い、レビューする価値あり
- > 5% — 大きな視覚的変化
例
例 1: Figmaのデザインと実装されたページを比較する
bash <skill-path>/scripts/image-compare.sh design.png screenshot.png
出力:
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.
例 2: 厳密な閾値を使用した視覚的リグレッションテスト
bash <skill-path>/scripts/image-compare.sh before.png after.png ./changes.png 0.05
より厳密な閾値0.05を使用すると、デプロイメント間のわずかなレンダリングの違いも検出できます。./changes.pngの差分画像は、検出されたすべての変更を赤色で強調表示します。
ガイドライン
- スクリプトは、両方の画像を自動的に小さい方の寸法にリサイズします。最良の結果を得るには、同じサイズの画像を使用してください。
- 偽陽性が多すぎる場合は、閾値を大きくしてください(例:
0.2)。アンチエイリアスの違いは、ブラウザ間でよく見られます。 - CI/CDの視覚的リグレッションの場合は、ミスマッチの閾値を設定し(例:> 1%の場合に失敗)、同じビューポートサイズで撮影したスクリーンショットを比較します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
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
- Both images are loaded and resized to match dimensions (uses the smaller of the two)
pixelmatchcompares every pixel and flags differences above a configurable threshold- 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 to0.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.
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (3,124 bytes)
- 📎 scripts/image-compare.js (1,879 bytes)
- 📎 scripts/image-compare.sh (521 bytes)