Communitygithub.com

jsath/claude-skills - 縮圖產生器

生成 1280x720 的 YouTube 縮圖(或橫幅/封面),在手機尺寸上清晰可讀:包含無文字的背景底板、人物的去背實照、1-3 個字的緊湊色塊、官方 Logo,並由腳本檢查重疊和邊緣,輸出 320px 與 168px 的預覽圖。適用於要求製作縮圖、封面、橫幅、『讓它更吸睛』,或修復看起來擁擠或太小的縮圖。

claude-skills - 縮圖產生器 是什麼?

這是一個專為 AI 代理(如 Claude Code)設計的縮圖生成技能,核心流程是『由 AI 模型生成背景底板,用程式碼組合文字與人物』。它解決了純 AI 生成圖片常有的文字拼寫錯誤與人物面部失真的問題:透過 Python 腳本 `compose_thumbnail.py` 將真實人物去背剪影、官方 Logo 以及 1-3 個字的彩色文字區塊(附帶陰影與襯色)精準合成到 1280x720 的底板上,並自動檢查重疊、邊界裁切、字數(上限 5 字)與最小尺寸。生成的結果包含原始封面、320px 與 168px 的並排預覽圖,以及可重複調整的 `layout.json` 設定檔。這個技能特別強調『縮圖必須在 168 像素寬度下仍可辨識』,並提供詳細的品質檢查清單與失敗處理指南,支援 Claude.ai 進行規劃與提示設計,但實際合成需要 Claude Code 執行 Shell 指令。它依賴 Pillow 與 rembg 進行圖片處理,人物圖片必須是真實照片(嚴禁生成虛構臉孔),背景底板則可由任何影像模型生成或直接取用影片畫面經模糊處理。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/jsath/claude-skills/tree/HEAD/skills/video/thumbnail-generator

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

縮圖產生器

方法:影像模型生成底板,程式碼生成文字。 生成的文字容易拼錯,生成的人臉會變成別人,因此文字、Logo 和人物的真實臉孔皆由 scripts/compose_thumbnail.py 合成,並由該腳本檢查佈局是否合理。

同系列技能:longform-edit 和 edit-style 負責產出影片與其幀畫面;本技能將某一幀畫面轉變為封面。

需求

  • Python 3.9+ 與 Pillow(pip install pillow)。必要。
  • 去背圖:pip install "rembg[cli]" 然後 rembg i photo.jpg cutout.png,或任何能輸出透明 PNG 的背景移除工具。
  • 底板(非必要):任何你可使用的影像模型(代理內的圖片生成工具、支援編輯端點的影像 API,或完全不用:將真實影片幀畫面模糊並加深顏色即可作為不錯的底板)。
  • Claude.ai 適用於規劃與提示設計;合成則需要 Claude Code(一個 Shell 環境)。

輸入

  • 影片的標題及其一句話的承諾。
  • 人物的真實照片或影片幀畫面,最好至少有 1500 像素高,並帶有影片所需的情緒(選擇該幀畫面;不要憑空想像臉孔)。
  • 任何被提及工具的官方 Logo(品牌媒體頁面或網站本身的 SVG)。
  • 選用:使用者希望參考的縮圖。先找出並研究那張確切的圖片(見 references/reference-matching.md)。

步驟

  1. 一行概念:觀眾看到的畫面 + 1 到 3 個字。如果需要超過 3 個字,概念就有問題。展示結果,隱藏手法。
  2. 製作底板(1280x720 或更大,16:9)。任何模型的提示規則:
    • "no people, no faces, no text, no letters, no logos"(務必加上)
    • 與主題相關的場景,能講述故事,而不是「黑暗房間加螢幕」
    • 高對比、一個主色、預留放置文字的空白空間
    • 避免預設的藍色/紫色 AI 漸層風格 替代方案:使用影片中的真實幀畫面,套用 gblur 並加深顏色 20% 到 40%。
  3. 將人物去背(從選擇的真實幀畫面,使用 rembg)。絕不憑文字生成人物。如果你使用影像模型重新設計人物風格,必須以真實幀畫面作為輸入圖片,並拒絕任何改變臉孔、牙齒或衣服的結果。
  4. 撰寫 layout.json(格式寫在腳本開頭)。起始值:去背圖 height 0.85 到 0.95(靠一側),底部對齊;標題 size 110 到 140;第二行 60 到 80;Logo width 180 到 260。
  5. 合成:python3 scripts/compose_thumbnail.py layout.json --out thumb.png。修正每一個 FAIL(重疊、超出畫面、去背圖高度低於 70%、超過 5 個字)。
  6. 查看 thumb.preview.png,先看 168 像素版本。執行下列的檢查清單。調整佈局,不要調整底板:只有在概念改變時才重新生成底板。
  7. 選用:一次潤飾:如果你的影像模型有編輯模式,將完成後的合成圖以低強度(0.3 至 0.5)透過它處理一次,調整光線與飽和度。然後再次檢查所有文字是否仍拼寫正確,臉孔是否還是同一個人。如果不是,則使用未經潤飾的版本出貨。

規則(來自被否決的縮圖經驗)

  • 層級:臉孔 > 標題 > Logo > 背景。
  • 所有東西都太小。 將元素放大到比感覺正確的大小再大 30% 到 50%;多數人看到的是 168 像素寬。
  • 文字在實色色塊內,緊貼字母的內邊距(1280 寬度下約 8 像素)、加上陰影。黃色 = 吸引注意、綠色 = 正面、紅色 = 危險(白色文字)、白色 = 中性。使用厚重無襯線壓縮字體(Impact, Bebas Neue)。
  • 沒有任何東西遮蓋臉孔。文字絕不跨越臉部。
  • 單一底板填滿畫面邊緣到邊緣:無空白區域、無可見接縫。
  • 重複或鏡像的元素顯得廉價:每個重複的元素都是各自獨立的圖片。
  • 每張新縮圖看起來都與該頻道最近幾張不同。
  • 不要將去背圖放大超過約 1.15 倍(腳本會提出警告):找一張更大的來源圖片。
  • Logo:使用官方、未經更改的顏色與比例,絕不能由 AI 重製。

品質保證檢查清單(在回覆中寫下答案)

  • 168 像素版本:每個字都讀得清楚、臉孔能辨識嗎?
  • 1 到 3 個字(最多 5 個),拼寫正確
  • 臉孔完全可見,沒有被裁切到下巴或額頭,沒有來源幀畫面的 UI 標籤
  • 無重疊、無元素被畫面邊緣裁切(腳本檢查 PASS)
  • 高對比、一個清楚焦點、無雜亂
  • 與頻道其他縮圖放在一起時,你會點擊它嗎?

輸出

thumb.png            1280x720 最終成品
thumb.preview.png    全尺寸 + 320 像素 + 168 像素並排顯示
layout.json          讓下一次調整只需重新執行,而非重新製作

範例回覆:

thumb.png PASS(合成檢查通過)。168px:「IT'S FREE」可讀,臉孔清晰。
概念:驚訝的臉 +「IT'S FREE」+ 工具 Logo;底板 = 從 03:12 擷取的影片幀畫面,模糊並加深 30%。
所有版本保留在 thumbs/v1..v3。

失敗處理

問題處理方式
沒有影像模型使用模糊加深的真實影片幀畫面作為底板
沒有好的真實人物照片要求提供;絕不生成替代臉孔
模型在底板中加入了文字或臉孔重新生成,提示詞開頭加上 "no text, no people",或直接裁切掉該區域
去背圖有光暈或頭髮缺失嘗試 rembg -m isnet-general-use,或選擇背景更單純的幀畫面
字體缺失(文字太小或使用備用字體)在 layout.json 中設定 "font" 為真實的粗體 .ttf 字型檔案

保留所有版本,直到使用者選定一個。進階參考:references/composition.md(尺寸、文字、圖層順序)以及 references/reference-matching.md(比對參考圖片、橫幅、方形廣告)。

Individual skills in this repo

This repo contains 11 individual skills — each has its own dedicated page.

jsath/claude-skills

Writes captions for a finished video from its transcript: pulls the line worth repeating, writes first-line options, writes per-platform versions (Instagram, TikTok, YouTube title and description, others on request), keeps the creator's voice using their best past captions, and checks the call to action matches what the video actually says. Use when a creator asks for captions, a caption hook, a YouTube title and description, or a CTA check. Drafts only; never posts or schedules.

jsath/claude-skills

Write CAPTIONS-PLATFORMS.md for one finished short video: a per-platform post caption for Instagram, TikTok, YouTube Shorts (title + description), Facebook, Threads, Bluesky and X, each within that platform's limits, with your comment-keyword CTA on the platforms where it belongs and never on X. Keyword, CTA, platforms, hashtags and limits come from a config file; a checker script fails the file on any miss. Use after an edit is finished, when asked to 'write the captions', 'caption this reel for every platform', or before scheduling.

jsath/claude-skills

Transcribe audio or video on your own machine with Whisper (mlx-whisper, faster-whisper or whisper.cpp) and get word-level timestamps as words.json, a plain .txt and an .srt. No API key, nothing uploaded. This is the transcription step the editing skills (edit-style, longform-edit, reel-captions) depend on. Use when asked to transcribe a take, get word timings, make an SRT, re-transcribe a final render for a caption sync check, or 'run whisper locally'.

jsath/claude-skills

Turns one published long-form video or podcast transcript into up to thirty pieces: 10 clips with new hooks and exact timestamps, 8 X posts, 4 LinkedIn posts, 3 carousels, 2 threads, a newsletter, a community post and a blog post, laid out on a two-week plan, all built only from what was said. In Claude Code it also cuts, reframes and captions the clips with ffmpeg. Use when someone wants to repurpose a long video, find clips, or write social posts from a transcript. Never posts or schedules.

jsath/claude-skills

Turn a raw talking-head take into a dynamically edited 1080x1920 reel: full-face, full-graphic and split layouts that switch every 2 to 5 seconds, real UI and official-logo panels, captions on every word timed by Whisper, voice plus synthesised SFX (no music bed) mastered to -14 LUFS, and hard QA gates (caption sync on the final render, A/V length, loudness, colour, framing, contact sheet, claims). Also covers writing the script so it does not read as AI. Use when asked to 'edit this reel', 'make it look edited', 'add captions / dynamic layout / graphics', or 'write a reel script'.

jsath/claude-skills

Edits a raw long-form YouTube recording (screen recording export, camera file, or either plus a separate mic) into a publish-ready video automatically, like Descript on autopilot: transcribes with word timestamps, removes retakes and keeps the last take, tightens dead space while keeping silent on-screen action (speeding up long waits), masters the voice to -14 LUFS / -1.5 dBTP with no music bed, re-transcribes the FINAL render for an every-word SRT (optional burned-in captions), drafts chapters, titles and a description, and fails loudly on QA gates (words, A/V sync, caption sync per chapter, caption coverage, loudness) plus contact sheets you look at. Use when someone says edit this long-form, clean up my recording, cut the retakes and dead space, process the long-form inbox, or descript this. Needs Claude Code with ffmpeg, whisper.cpp and Python 3.

jsath/claude-skills

Turns one podcast episode transcript into a week of written content: an Episode Prep agent that checks the transcript and speaker names, a Clip Spotter that picks the best short-clip moments with exact timestamps and hooks for an editor to cut, a Show Notes Writer that writes show notes and chapter markers, a Repurpose Writer that turns the big ideas into a newsletter, a LinkedIn post and Instagram captions, and an Episode Planner that spreads it all over the week. Works from a transcript the user supplies or exports from their transcription tool. It does not edit audio or video and does not cut clips. Use when a podcaster asks for show notes, chapters, clip timestamps, or posts from an episode, or says \"repurpose this episode\". Drafts only; never posts.

jsath/claude-skills

Turns one raw talking-head take into a finished 1080x1920 vertical reel in Claude Code with free local tools (ffmpeg, whisper.cpp, headless Playwright): transcribes, keeps the last take of repeated lines, cuts pauses, captions every word, adds real screenshots and official logos, and runs measured QA gates. Use when someone wants a raw phone take edited into a Reel, TikTok or Short, retakes and silences cut, word-by-word captions, or a finished video checked. In Claude.ai it only produces a cut list, shot plan and .srt from a pasted transcript.

jsath/claude-skills

Turns notes, voice-note transcripts and half ideas into Reel, TikTok and YouTube scripts in the creator's own voice: ranks an idea bank, writes ten hooks per idea, writes the script at the right length, rewrites anything that sounds like AI using transcripts of the creator's past videos, and fact-checks every claim with a source and date. Use when someone wants a video script, hooks, a ranked list of what to film, a voice pass, a claims check, or a record sheet to read from while filming.

jsath/claude-skills

Reviews and rewrites a video script (YouTube long-form, a short, or a talking-head reel) so it sounds like one person talking to one friend and holds attention: kills forced analogies and presenter phrases, fixes framing, checks hooks, open loops and re-engagement beats, and suggests titles. Use when someone says fix this script, polish my script, make it sound like me, tighten this before I film, or asks for a hook or title for a video. Returns the rewritten script plus a short change log.

jsath/claude-skills

Runs five agents that keep a YouTube channel's titles and descriptions matched to what people search for now: a Channel Reader that pulls the user's own video list and stats with their YouTube Data API key, YouTube Analytics OAuth or a pasted YouTube Studio export, a Niche Watcher that finds what is working right now for similar-size channels from public search results the API returns or the user provides, a Title Writer that drafts titles, descriptions and chapters for new videos, a Back Catalogue agent that picks old videos worth a refresh and drafts new versions, and a Change Tracker that records every change the user makes and compares before and after on matched windows. Use when a creator asks for YouTube SEO, better titles or descriptions, what is working in their niche, a back catalogue refresh, or says \"seo run\". Never invents search volumes or stats and never changes a video; drafts only.

相關技能