mcpField
O
og-image-design

og-image-design

github.com/magentoshデザイン・UI443 回インストール12 週間前に更新
リポジトリ

og-image-design について

inference.sh で Open Graph のシェア画像を作成する belt CLI スキルです。コンテンツ制作者やサイトチーム向けに、各プラットフォームのサイズ、レイアウト、生成手順を案内します。

主な機能

  1. 01HTML-to-image による画像生成
  2. 02プラットフォーム別サイズの参照
  3. 03文字・コントラスト・セーフゾーンの指針
  4. 04内容別画像テンプレートの作成
  5. 05複数ページでの画像スタイル統一

活用シーン

  1. 01ブログ記事のシェアカード作成
  2. 02製品発表用画像のデザイン
  3. 03チュートリアルのプレビュー画像作成

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/magentosh/superpowers --skill og-image-design

インストール後、Claude Code で/og-image-designを入力して読み込まれたか確認します。

詳細

belt CLI スキルをインストールする: npx skills add belt-sh/cli

OG 画像のデザイン

inference.sh CLI を使って、ソーシャル共有画像(Open Graph)を作成します。

クイックスタート

inference.sh CLI(belt)が必要です。インストール手順

belt login

# Generate an OG image with HTML-to-image
belt app run infsh/html-to-image --input '{
  "html": "<div style=\"width:1200px;height:630px;background:linear-gradient(135deg,#1a1a2e,#16213e);display:flex;align-items:center;padding:60px;font-family:system-ui;color:white\"><div><h1 style=\"font-size:56px;margin:0;line-height:1.2\">How We Reduced Build Times by 80%</h1><p style=\"font-size:24px;opacity:0.8;margin-top:20px\">engineering.yourcompany.com</p></div></div>"
}'

プラットフォームごとの仕様

プラットフォーム寸法アスペクト比ファイルサイズ形式
Facebook1200 x 630 px1.91:1< 8 MBJPG, PNG
Twitter/X (summary_large_image)1200 x 628 px1.91:1< 5 MBJPG, PNG, WEBP, GIF
Twitter/X (summary)800 x 418 px1.91:1< 5 MBJPG, PNG
LinkedIn1200 x 627 px1.91:1< 5 MBJPG, PNG
Discord1200 x 630 px1.91:1< 8 MBJPG, PNG
Slack1200 x 630 px1.91:1—JPG, PNG
iMessage1200 x 630 px1.91:1—JPG, PNG

どのプラットフォームでも使いやすい設定:1200 x 630 px、PNG または JPG、5 MB 未満。

基本のレイアウト

┌──────────────────────────────────────────────────┐
│                                                  │
│  ┌─────────────────────────────────┐  ┌───────┐  │
│  │                                 │  │       │  │
│  │  Title Text (max 60 chars)      │  │ Logo/ │  │
│  │  ───────────────────            │  │ Visual│  │
│  │  Subtitle (max 100 chars)       │  │       │  │
│  │                                 │  │       │  │
│  │  author / site name             │  └───────┘  │
│  └─────────────────────────────────┘             │
│                                                  │
└──────────────────────────────────────────────────┘
  1200 x 630 px

デザインのルール

テキスト
ルール値
タイトルのフォントサイズ48-64px
サブタイトルのフォントサイズ20-28px
タイトルの最大文字数60 文字(一部のプラットフォームでは切り詰められます)
サブタイトルの最大文字数100 文字
行の高さタイトルは 1.2-1.3
フォントの太さタイトルは Bold/Black、サブタイトルは Regular
テキストのコントラストWCAG AA の最低基準(比率 4.5:1)
セーフゾーン
┌──────────────────────────────────────────────────┐
│  ┌──────────────────────────────────────────────┐│
│  │ 40px padding from all edges                  ││
│  │                                              ││
│  │  Content lives here                          ││
│  │                                              ││
│  │                                              ││
│  └──────────────────────────────────────────────┘│
└──────────────────────────────────────────────────┘
  • すべての端から最低 40px の余白を確保します
  • プラットフォームによっては、端がトリミングされたり、角が丸くなったりします
  • 外側 5% の範囲には重要なテキストを配置しないでください
色
背景の種類使用する場面
単色のブランドカラーシリーズでの統一感、企業向け
グラデーションモダンで目を引くデザイン
オーバーレイ付き写真ブログ記事、編集コンテンツ
暗い背景コントラストが高く、フィード内で目立ちます

**ソーシャルフィードでは暗い背景のほうが効果的です。**フィードの多くは白や明るい背景なので、暗い OG 画像が目立ちます。

コンテンツの種類別テンプレート

ブログ記事
belt app run infsh/html-to-image --input '{
  "html": "<div style=\"width:1200px;height:630px;background:linear-gradient(135deg,#667eea,#764ba2);display:flex;align-items:center;padding:60px;font-family:system-ui,sans-serif;color:white\"><div style=\"flex:1\"><p style=\"font-size:18px;text-transform:uppercase;letter-spacing:2px;opacity:0.8;margin:0\">Engineering Blog</p><h1 style=\"font-size:52px;margin:16px 0 0;line-height:1.2;font-weight:800\">How We Reduced Build Times by 80%</h1><p style=\"font-size:22px;opacity:0.9;margin-top:16px\">A deep dive into our CI/CD optimization</p></div></div>"
}'
製品・ローンチのお知らせ
belt app run infsh/html-to-image --input '{
  "html": "<div style=\"width:1200px;height:630px;background:#0f0f0f;display:flex;align-items:center;justify-content:center;font-family:system-ui;color:white;text-align:center\"><div><p style=\"font-size:20px;color:#22c55e;text-transform:uppercase;letter-spacing:3px\">Now Available</p><h1 style=\"font-size:64px;margin:12px 0;font-weight:900\">DataFlow 2.0</h1><p style=\"font-size:24px;opacity:0.7\">Automated reports. Zero configuration.</p></div></div>"
}'
チュートリアル・手順ガイド
belt app run infsh/html-to-image --input '{
  "html": "<div style=\"width:1200px;height:630px;background:linear-gradient(to right,#1a1a2e,#16213e);display:flex;align-items:center;padding:60px;font-family:system-ui;color:white\"><div><div style=\"display:inline-block;background:#e74c3c;color:white;padding:8px 16px;border-radius:4px;font-size:16px;font-weight:bold;margin-bottom:16px\">TUTORIAL</div><h1 style=\"font-size:48px;margin:0;line-height:1.2\">Build a REST API in 10 Minutes with Node.js</h1><p style=\"font-size:20px;opacity:0.7;margin-top:16px\">Step-by-step guide with code examples</p></div></div>"
}'
AI 生成ビジュアル OG
# When you want a striking visual instead of text-based
belt app run falai/flux-dev-lora --input '{
  "prompt": "clean professional social sharing card, dark gradient background, abstract geometric shapes, modern tech aesthetic, minimal, no text, 1200x630 equivalent aspect ratio",
  "width": 1200,
  "height": 630
}'

OG メタタグのリファレンス


<meta property="og:title" content="Title here (60 chars max)" />
<meta property="og:description" content="Description (155 chars max)" />
<meta property="og:image" content="https://yoursite.com/og-image.png" />
<meta property="og:url" content="https://yoursite.com/page" />
<meta property="og:type" content="article" />


<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Title here" />
<meta name="twitter:description" content="Description" />
<meta name="twitter:image" content="https://yoursite.com/og-image.png" />


<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
Twitter カードの種類
カードの種類画像サイズ使用する場面
summary800 x 418(小さなサムネイル)短い更新情報、リンク
summary_large_image1200 x 628(全幅)ブログ記事、記事、お知らせ

特別な理由がない限り、常に summary_large_image を使用してください。大きな画像のほうがクリック数が大幅に増えます。

統一感を保つ仕組み

多数のページがあるブログやサイトでは、テンプレートシステムを作成します。

要素統一する項目変化させる項目
背景のスタイル同じグラデーションまたはブランドカラー—
フォントファミリー同じフォント—
レイアウト同じ配置—
ロゴ・ブランディング同じ配置(角)—
カテゴリーバッジ同じスタイルカテゴリーごとの色
タイトルテキスト同じサイズ・太さ内容を変更

OG 画像のテスト

ツールURL
Facebook Debuggerdevelopers.facebook.com/tools/debug/
Twitter Card Validatorcards-dev.twitter.com/validator
LinkedIn Post Inspectorlinkedin.com/post-inspector/
OpenGraph.xyzopengraph.xyz
# Research OG debugging tools
belt app run tavily/search-assistant --input '{
  "query": "open graph image debugger preview tool test og:image"
}'

よくある間違い

間違い問題修正方法
OG 画像がないプラットフォームにページ内の無関係な要素が表示されるか、何も表示されません必ず og:image を設定します
テキストが小さすぎるモバイルのプレビューで読めません幅 1200px の場合、タイトルは最低 48px にします
明るい背景白や明るいフィードに埋もれます暗い色または彩度の高い背景を使います
テキストが多すぎるごちゃごちゃして、圧迫感がありますタイトル+サブタイトル+ブランド名までにします
画像が大きすぎる(>5MB)一部のプラットフォームで読み込めませんできれば 1MB 未満に最適化します
セーフゾーンの余白がない一部のプラットフォームでテキストが切り取られますすべての端から 40px の余白を設けます
プラットフォームごとに画像が異なる共有時の表示に一貫性がなくなりますすべてに 1200x630 を使います
HTTP の画像 URL多くのプラットフォームで HTTPS が必要ですOG 画像は必ず HTTPS で配信します
相対画像パス共有時に解決できません完全な絶対 URL を使います

関連スキル

npx skills add inference-sh/skills@ai-image-generation
npx skills add inference-sh/skills@landing-page-design
npx skills add inference-sh/skills@prompt-engineering

すべてのアプリを閲覧:belt app list

コメント