Communitygithub.com

ループカバーGIF生成

ニュースレターやブログのカバー画像を、896×640、180フレーム、20fpsのシームレスなループGIFに変換します。指定した1つの要素だけが動き、ループは回転されてフレーム1が完成画像になり、継ぎ目は目測ではなく測定されます。誰かが「動くカバーが欲しい」と言ったときに使います。

ループカバーGIF生成 とは?

このスキルは、静止画のカバーをループGIFに変換し、フィード内で目立たせるためのものです。ユーザーはカバー画像またはHTML、動かしたい要素(例:「灯台の光」)、動作の種類(パルス、描画、スローなドリフト、グロー)を指定します。GIFは、指定された要素のみを時間の純粋な関数としてアニメーションさせ、180フレームを20fpsでキャプチャします。重要なのは、ループが回転されてフレーム1が完成画像になることです。これにより、受信ボックスやリンクプレビューで一瞬だけ表示される最初のフレームが、それ単体でも意味を持ちます。継ぎ目はffmpegとPythonで定量的に測定され、目標値は0.0~0.3です。このスキルは、画像またはHTMLで構築されたカバーをサポートし、事前にbrand.mdやMOTION.mdの確認、またはbrand-intakeの実行が必要です。コードベースのアニメーションにより、カメラの動きが完全に固定され、指定された要素のみが動くことが保証されます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/charlie947/motion-graphics-skills/tree/main/skills/loop-cover

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

ループするカバーGIF

動くカバーは、静止画だらけのフィードで目を引きます。動きが小さく、ループが決して飛ばず、最初のフレームが単体でも意味をなす場合にのみ機能します。

始める前に: brand.md と MOTION.md が存在する場合はそれらを読んでください。存在しない場合は、最初に brand-intake を実行するか、16進数カラーコード、フォント、ロゴファイルを尋ねてください。これらなしで結果を「ブランド準拠」と呼んではいけません。

ステップ1: 3つのことを尋ね、そして待つ

  1. カバー画像。 完成した静止画(PNG)、またはHTMLで構築されたカバー。896 x 640、または同じ7:5のアスペクト比を持つ大きな画像。
  2. 動く1つの要素 を平易な名前で指定します。「灯台の光。」「オレンジの線が自動描画される。」「セル間の線。」
  3. どのように動くか。 パルス、描画、スローなドリフト、またはグロー。1つの動きであり、3つではありません。

ステップ2: 構築する

カバーがHTMLの場合: 指定された要素のみを時間の純粋な関数としてアニメーションさせ、window.seek(seconds) を追加し、180フレームを20fps(9秒)でキャプチャします。

カバーが画像の場合: コード内で静止画をアニメーションさせます。指定された要素のマスクを色で作成し(例えば、青が赤よりもはるかに強いすべてのピクセル)、そのエッジを数ピクセルぼかし、そのピクセルのみをフレームごとに変更します。マスクの外側では何も動きません。

どちらの場合も、9秒間にわたって1つのクリーンなサイン波サイクル、または1つの描画、ホールド、フェードを使用し、最後のフレームが最初のフレームに流れ込むようにします。

ループを回転させて、フレーム1が完成画像になるようにします。 受信ボックスとリンクプレビューはフレーム1を静止画として表示します。フレームiは、((i + offset) mod 180) / 20 秒の瞬間を描画します。ここで offset は、完全に描画された状態を最初に配置します。

ディザリングなしでエンコードします。ディザリングはフラットな画像のすべてのフレームにちらつきを追加するためです:

ffmpeg -y -framerate 20 -i f%03d.png -filter_complex "split[x][y];[x]palettegen=max_colors=128:stats_mode=full[p];[y][p]paletteuse=dither=none" -loop 0 cover.gif

ステップ3: 測定する

ffmpeg -v error -y -i cover.gif -vf scale=216:154,format=gray -f rawvideo frames.raw
python3 -c "
n = 216 * 154
d = open('frames.raw', 'rb').read()
f = [d[i:i + n] for i in range(0, len(d), n)]
diff = lambda a, b: sum(abs(x - y) for x, y in zip(a, b)) / n
print('frames', len(f))
print('seam', round(diff(f[-1], f[0]), 2))
print('excursion', round(max(diff(x, f[0]) for x in f), 2))
"

私がこれまでに出荷したカバーからの目標値: 180フレーム、継ぎ目0.0~0.3、動き幅約0.7~2.8、ファイルサイズ0.6~2.3 MB。動き幅がゼロに近い場合は、視覚的に動くものがないことを意味します。

苦労して学んだこと

  • 「画像が完全に変わってしまった」 最初のGIFはバンドをフレーム全体にスイープさせていました。名前が指定されたものだけをアニメーションさせてください。
  • ビデオモデルはカメラムーブを追加する。 「カメラは完全に静止」と指示しても、それでも押し込もうとします。コード内で静止画をアニメーションさせることが、カメラを固定する唯一の方法です。
  • 中途半端なフレームで動きを測定してはいけない。 サイン波はそこでゼロに戻るため、正常なアニメーションでも動きがないと報告されます。フレーム0に対する最大の変化を測定してください。
  • ffmpeg の eq フィルターでは eval=frame を追加する そうしないと、式が1回実行されるだけで何も動きません。
  • 240px幅に縮小してもう一度見る。 それが受信ボックスでのサイズです。動く要素が消えて見えたら、小さすぎます。
  • GIF自体をアップロードする。 一部のアップロードツールはPNGに変換し、アニメーションが静かに消えてしまいます。アップロードされたリンクがまだ .gif で終わっているか確認してください。

Individual skills in this repo

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

animated-chart

Make a looping animated chart for LinkedIn or a newsletter in code with Claude Code. Bars that become a line, a number that counts up, a before and after. Every value stays exactly as given. Use when someone says

apple-launch-film

Rebuild an Apple-style Mac launch film entirely in code with Claude Code. A thin menu bar, the black notch growing into widgets one scene at a time, full-screen gradient wallpapers and one short caption per scene. No screen recording, no After Effects. Use when someone says

brand-intake

The setup step every other skill in this pack reads. A short interview plus 3 to 5 reference frames becomes two files in your project, brand.md (who you are, what you sell, your assets) and MOTION.md (your colours, type, timing and motion rules), plus a rule in CLAUDE.md so Claude reads them before it animates anything. Use at the start of any motion project, or when someone says

launch-video

Make a 30-45 second product launch video in code with Claude Code, the kind SaaS companies post on launch day. One sentence split across scenes, real product screens with slow camera moves, a typed prompt, a proof beat and a clear call to action. Use when someone says

milestone-reveal

Make a 12-second looping milestone clip in code with Claude Code. Thousands of tiny points drift like a night sky, pull together into your real number (followers, subscribers, revenue, customers), a line draws underneath and the label settles in. Premium, not a party. Use when someone says

model-showdown

Give the same motion brief to three AI models, keep each first try, render all three the same way and stack them into one comparison video with model names and logos. Makes a 16:9 side-by-side for a newsletter and a 1080 x 1920 stacked reel for Instagram and TikTok. Use when someone says

motion-brief-writer

Turns a rough idea for an animated graphic into a precise build brief for Claude Code, in your own brand. Asks for anything essential first (exact numbers, size, length, brand), keeps real results apart from sample data, and never invents a figure. Use when someone says

motion-effects

Build any of 16 premium motion effects from scratch in your own brand, as one 8-second looping HTML file with window.seek(seconds) so it exports frame-exact to MP4 or GIF. Interfaces (button to player, search to results, card to workspace, tabs to panels), data (chart morph, dashboard zoom, spring stack, magnetic dock), type (masked type, elastic type, text to layout, image reveal) and systems (perspective shift, glass focus, flowing paths, particle logo). Use when someone says

motion-prompt-writer

Write a complete 8-part Claude Motion prompt (The bar, Format, The one rule, Look, Motion, Never, Before you finish, The scene) for one short looping motion graphic, in your own brand. Takes your brand (a website screenshot, a logo, hex codes, or nothing for the Apple-style default) and one moment you want to show, in plain words. Use when someone says

newsletter-promo

Turn a newsletter edition into a 12-20 second promo clip for LinkedIn, Instagram or X that drives people to read and subscribe. Hook question, three proof frames from the edition, then the newsletter name and where to read it. Use when someone says

reel-export

Turn any horizontal or square motion video into a 1080 x 1920 Instagram Reel or TikTok that uploads cleanly. Headline and logos inside the safe zone, H.264, yuv420p, limited colour range, bt709, a silent audio track when there is no sound, and an ffprobe check before upload. Use when someone says

reference-to-motion

Turn references you admire into a scene-by-scene Claude Motion prompt for your own topic and brand. Takes a video for the moves (screenshots, frames or a contact sheet of a reel or ad) and, optionally, a look reference for the style (a website, a brand, a moodboard). Use when someone says

title-sequence-3d

Make a cinematic 3D title sequence (8-15 seconds) in code with Claude Code and Three.js. A camera moves through a lit scene, such as a rainy street at night with brand names as neon signs, then a big question or title lands. Use when someone wants a scroll-stopping opener, a film-style intro,

vox-explainer

Make a short Vox-style documentary explainer (30-60 seconds) entirely in code with Claude Code. Torn paper, halftone texture, bold condensed type, motion on twos. Use when someone says

関連スキル