Community图像github.com

video-cover

两阶段多平台视频封面生成与元素重排工作流:第1回合先生成 1~3 版带完整图文光影的 16:9 母版封面并卡点等待用户拍板;确认后第2回合按各平台画幅特性并发对元素做真·重新排版(禁止硬裁切或简单拉伸),再由纯 Python 脚本精确对齐交付分辨率(1920×1080 / 1440×1080 / 1080×1440)、硬拼微信公众号 3618×1080 双联头图(2538×1080 + 1080×1080,X=2538)并生成安全区与手机缩略图质检看板自动验收。当用户要做视频封面、多尺寸封面、一图多版、B站/YouTube/小红书/抖音/视频号封面或公众号头图时使用。

video-cover 是什么?

video-cover is a Codex agent skill that 两阶段多平台视频封面生成与元素重排工作流:第1回合先生成 1~3 版带完整图文光影的 16:9 母版封面并卡点等待用户拍板;确认后第2回合按各平台画幅特性并发对元素做真·重新排版(禁止硬裁切或简单拉伸),再由纯 Python 脚本精确对齐交付分辨率(1920×1080 / 1440×1080 / 1080×1440)、硬拼微信公众号 3618×1080 双联头图(2538×1080 + 1080×1080,X=2538)并生成安全区与手机缩略图质检看板自动验收。当用户要做视频封面、多尺寸封面、一图多版、B站/YouTube/小红书/抖音/视频号封面或公众号头图时使用。.

兼容平台~Claude Code✓Codex CLI~Cursor✓Antigravity
npx skills add https://github.com/zzzllp/video-cover-skill/tree/HEAD

Installed? Explore more 图像 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Multi-Platform Video Cover Workflow (Video Cover)

Core Design Principles:

  1. WYSIWYG, Master One Version First Then Expand: First produce a complete 16:9 cover draft for user approval; do not generate multiple sizes before confirmation.
  2. True Element Rearrangement, Not Lazy Cropping: Different platform aspect ratios vary significantly. Changing from landscape to portrait, square, or ultra-wide must genuinely rearrange the subject framing, title line breaks, negative space, and visual focus for the target ratio, not simply crop or stretch.
  3. AI Handles Creativity and Rearrangement, Script Handles Deterministic Pixels and QA: Image generation/editing uses the current host's built-in capabilities (e.g., Codex image_gen, DSH built-in GPT image generation, Antigravity image-generator). Precise resolution alignment, WeChat dual-image stitching, and QA sheet generation are handled deterministically by scripts/pack_covers.py.
Phase 1  16:9 Full Master Draft (1–3 versions)  ──►  User explicitly approves 1 version
                                                │  ← Hard gate: No approval, cannot proceed
Phase 2  Concurrent true rearrangement based on master (4:3 / 3:4 / 2.35:1 / 1:1)
          └──► pack_covers.py precise pixel alignment + stitch 3618×1080 + generate qa_sheet.png
                 └──► Self-inspect qa_sheet.png (if one is wrong, regenerate only that one) ──► Deliver full set

Default Delivery Matrix (Fixed 4-Piece Set)

Delivery FileAspect RatioExact PixelsTarget Platforms
16x9.png16:91920 × 1080Bilibili / YouTube landscape main image
4x3.png4:31440 × 1080Bilibili / WeChat Channels / Douyin landscape
3x4.png3:41080 × 1440Xiaohongshu / Douyin / WeChat Channels portrait
wechat_3618x1080.pngCombined canvas3618 × 1080WeChat Official Account single dual-cover: left 2538×1080 (2.35:1) + right 1080×1080 (1:1), seam fixed at X = 2538

If the user explicitly requests only certain platforms (e.g., "Just the Douyin version" or "Only the Xiaohongshu portrait"), generate only those aspect ratios. Full layout rules and safe zone values are in references/layout-specs.md.


Phase 1 · 16:9 Master Draft (Includes Hard Gate)

Goal: Let the user see the complete composition, lighting, and title impact to select a single visual baseline.

Execution Steps:

  1. Extract Cover Package (Align Information First):
    • From the user's request or spoken script, extract: core selling point/hook, verbatim locked main title (recommend no more than 12 Chinese characters, naturally split into 1–2 lines), optional subtitle/corner mark, core subject.
    • If the user provides a real person photo, product image, or 3D render, record it as an "identity anchor reference image" and use it as reference input during generation to lock facial features and product appearance details.
  2. Generate 1–3 Distinct 16:9 Full Covers:
    • Use the current host's built-in image generation tool, requesting native 16:9 ratio (prefer model-supported custom sizes like 2048×1152 or 16:9 preset).
    • If generating 2–3 candidates, they must be visually distinct, covering: composition zone (text left / main right vs. text right / main left vs. centered impact), style and material tone (e.g., dark industrial macro / light gray minimalist editing / high-contrast documentary cinematic), title hierarchy.
    • The prompt must lock the Chinese title in quotes verbatim; prohibit the model from adding English slogans, fake logos, or watermarks.
  3. Display and Wait for Approval:
    • Show the generated 16:9 candidates to the user. Briefly describe each's visual positioning and explicitly ask: "Which version should be the master? Does the copy or image need adjustment?"

⚠️ Hard Gate (Cannot Bypass)

Without the user explicitly confirming one version (e.g., "Version 2" or "This version is final, produce multi-size"), you are strictly forbidden from proceeding to Phase 2, generating 4:3 / 3:4 / 2.35:1 / 1:1, or running pack_covers.py.


Phase 2 · Concurrent True Element Rearrangement + Precise Packaging and Self-Inspection

Goal: Using the user-approved 16:9 master as the only visual source, rearrange elements according to each platform's aspect ratio constraints, produce pixel-perfect deliverables, and complete a self-inspection loop.

Execution Steps:

1. Lock Master Invariants

Before initiating multi-ratio rearrangement, internally lock the following list and reuse verbatim in all image editing instructions:

  • Unique Visual Master: The user-approved 16:9 final image (if on local disk and the host requires the image in context, first use the image viewing tool to read it).
  • Identity Anchor Original (if any): The user-provided real person or product image. Use it together with the master as a dual image anchor (Image 1 locks tone/lighting/font mood; Image 2 locks face/features/product details) to prevent distortion during enlargement/rearrangement.
  • Verbatim Copy: Record the main title, punctuation, and numbers exactly; do not translate, abbreviate, or add words.

2. Single Round Concurrent Calls: True Element Rearrangement by Platform Recipe

In the same round, launch parallel image editing calls for each target aspect ratio (all using the confirmed 16:9 master as source; strictly avoid chaining by using 4:3 to modify 3:4). For each ratio, strictly follow the composition recipes in references/layout-specs.md:

  • 4:3 (target 1440×1080, request native 4:3): Balanced compact landscape; show subject from upper body, with clear left-right or front-back hierarchy with title; enlarge title slightly for legibility on thumbnails.
  • 3:4 (target 1080×1440, request native 3:4): High-density landscape-to-portrait rearrangement; show subject from upper body, centered or slightly lower; break main title naturally into 2–4 lines, place in upper or lower center; force 15% safe zone at the bottom to avoid platform UI progress bars and text overlays.
  • 1:1 (target 1080×1080, request native 1:1): Compact square composition; trim side background, pull core subject and 2–4 line large text toward center; reserve 10% safe margin on all sides to prevent cropping by share cards and rounded corners.
  • 2.35:1 (target 2538×1080, request native 2.35:1): Cinematic widescreen editorial feel; horizontal breathing space; default to de-emphasizing large faces, express theme with core objects/scene ambiance or distant environmental characters; title concise horizontal, kept away from left/right edges.

3. Run Deterministic Packaging and QA Sheet Script

After obtaining each ratio's rearranged image, immediately execute the repository's pure Python script (depends only on Pillow, no browser dependency):

python "<skill-dir>/scripts/pack_covers.py" \
  --out-dir "<target output directory>" \
  --r16x9 "<confirmed 16x9 master path>" \
  --r4x3 "<4x3 rearranged image path>" \
  --r3x4 "<3x4 rearranged image path>" \
  --r235x100 "<2.35x1 rearranged image path>" \
  --r1x1 "<1x1 rearranged image path>"

The script automatically performs:

  1. Aspect Ratio Sanity Check: If a wrong ratio image is passed (aspect ratio deviation >12%), immediately raise an error and stop;
  2. Precise Pixel Alignment: No stretching or distortion; use Lanczos high-precision resampling + slight sharpening (only when upscaling) to align to standard delivery resolution;
  3. WeChat Dual-Image Stitching: Automatically stitch 2538×1080 and 1080×1080 at the fixed seam X = 2538, outputting wechat_3618x1080.png;
  4. Generate Combined QA Sheet: Output qa_sheet.png (4-piece set overlaid with precise safe zone dashed lines, portrait bottom 15% UI occlusion warning strip, WeChat seam line, and a 1:1 real-pixel simulated mobile feed thumbnail at the bottom).

4. Self-Inspect with Image Viewer and Spot-Heal (Do Not Deliver Rejects to User)

Must use the image viewing tool to read the generated qa_sheet.png and check against the 7 acceptance criteria in references/layout-specs.md:

  • If all pass, show the user qa_sheet.png and list the delivery files.
  • If a single ratio fails (e.g., 1:1 has a wrong stroke, or 3:4 title falls into the bottom red UI occlusion zone), only call out the specific issue for that ratio, regenerate it once, then rerun pack_covers.py with only that slot (the script will automatically reuse other qualified slots in the directory and recombine wechat_3618x1080.png and qa_sheet.png):
python "<skill-dir>/scripts/pack_covers.py" \
  --out-dir "<target output directory>" \
  --r1x1 "<corrected 1x1 image path>"

Reference Resources

  • references/layout-specs.md — Exact size matrix, per-aspect-ratio safe zone definitions, prompt writing templates, and 7 delivery acceptance criteria.
  • scripts/pack_covers.py — Cross-platform pure Pillow packaging script (supports full packaging and single-slot hot update).

相关技能