gemini-image について
Gemini CLI から Gemini Pro のビジョン機能を使って画像を分析するスキルです。画像説明、OCR、画面やエラーの分析、図表の理解、画像比較に対応します。
主な機能
- 01単一または複数画像の分析
- 02画像からテキストやコードを抽出
- 03画面やエラーのスクリーンショットを確認
- 04図やチャートの解説
- 05変更前後の画像を比較
- 06デザインフィードバックや文書の作成
活用シーン
- 01スクリーンショット内の文字を読む
- 02画面に表示されたエラーを調査
- 03チャートからデータを抽出
- 04デザインを評価または改訂版を比較
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ johnlindquist/ claude --skill gemini-imageインストール後、Claude Code で/gemini-imageを入力して読み込まれたか確認します。
詳細
Gemini 画像分析
Gemini Pro のビジョン機能を使用して画像を分析します。
前提条件
pip install google-generativeai
export GEMINI_API_KEY=your_api_key
CLI リファレンス
基本的な画像分析
# Analyze an image
gemini -m pro -f /path/to/image.png "Describe this image in detail"
# With specific question
gemini -m pro -f screenshot.png "What error message is shown?"
# Multiple images
gemini -m pro -f image1.png -f image2.png "Compare these two images"
分析操作
一般的な説明
gemini -m pro -f image.png "Describe this image comprehensively:
1. Main subject/content
2. Colors and composition
3. Text visible (if any)
4. Context and purpose
5. Notable details"
テキストの抽出(OCR)
gemini -m pro -f screenshot.png "Extract all text from this image.
Format as plain text, preserving layout where possible.
Include any text in buttons, labels, or UI elements."
スクリーンショットからのコード
gemini -m pro -f code-screenshot.png "Extract the code from this screenshot.
Provide as properly formatted code with correct indentation.
Note any parts that are unclear or partially visible."
UI 分析
gemini -m pro -f ui-screenshot.png "Analyze this UI:
1. What application/website is this?
2. What page/screen is shown?
3. Main UI elements and their purpose
4. User flow/actions available
5. Any UX issues or suggestions"
エラー分析
gemini -m pro -f error-screenshot.png "Analyze this error:
1. What error is shown?
2. What is the likely cause?
3. How to fix it?
4. Any related information visible?"
図の理解
gemini -m pro -f diagram.png "Explain this diagram:
1. What type of diagram is this?
2. Main components and their relationships
3. Data/process flow
4. Key takeaways"
具体的なユースケース
デバッグ用スクリーンショット
gemini -m pro -f debug-screen.png "I'm debugging an issue. From this screenshot:
1. What is the current state?
2. What errors or warnings are visible?
3. What should I look at?
4. Suggested next steps"
ビフォーアフターの比較
gemini -m pro -f before.png -f after.png "Compare these before and after images:
1. What changed?
2. Is this an improvement?
3. Any issues in the 'after' version?
4. Anything missing?"
デザインフィードバック
gemini -m pro -f design.png "Provide design feedback:
1. Visual hierarchy
2. Color usage
3. Typography
4. Spacing and alignment
5. Accessibility concerns
6. Suggestions for improvement"
データ抽出
gemini -m pro -f chart.png "Extract data from this chart:
1. Chart type
2. Data series and values
3. Axes labels and ranges
4. Key trends or insights
5. Output as structured data if possible"
フォーム分析
gemini -m pro -f form.png "Analyze this form:
1. Form purpose
2. Fields and their types
3. Required vs optional
4. Validation rules visible
5. UX suggestions"
ワークフローパターン
スクリーンショットから Issue へ
# Capture screenshot (macOS)
screencapture -i /tmp/bug.png
# Analyze and format as issue
gemini -m pro -f /tmp/bug.png "Create a bug report from this screenshot:
## Summary
[One-line description]
## Steps to Reproduce
[Inferred from screenshot]
## Expected Behavior
[What should happen]
## Actual Behavior
[What the screenshot shows]
## Environment
[Any visible system info]"
UI からコードへ
gemini -m pro -f ui-design.png "Generate React component code that recreates this UI:
- Use Tailwind CSS for styling
- Make it responsive
- Include proper TypeScript types
- Add appropriate accessibility attributes"
ドキュメント
gemini -m pro -f app-screen.png "Write user documentation for this screen:
- What this screen is for
- How to use each feature
- Common tasks
- Tips and notes"
対応している画像形式
- PNG、JPEG、GIF、WebP
- スクリーンショット
- 写真
- 図やチャート
- UI モックアップ
- コードスニペット
- ドキュメント
ベストプラクティス
- 鮮明な画像を使用する - 高品質なほど分析精度が向上します
- 関連する領域にトリミングする - 不要なコンテキストを削除します
- 具体的な質問をする - 曖昧なプロンプトでは曖昧な回答しか得られません
- コンテキストを提供する - Gemini に何を探しているのかを伝えます
- 抽出されたテキストを確認する - OCR は完璧ではありません
- 複数の角度から - 複雑な対象には複数の画像を使用します
コメント
Markdown 対応