Skip to content

Turn one topic into a finished Vox-style paper-collage explainer/ad video — automated end to end on Atlas Cloud + ffmpeg. An agent skill.

captions: default to clean white style, keep paper cut-out as opt-in (drop band)

Alisa0808c22681a6d101
diff --git a/SKILL.md b/SKILL.md
index 12d247f..13730d3 100644
--- a/SKILL.md
+++ b/SKILL.md
@@ -148,6 +148,7 @@ Add a `shots` array to each beat (see schema). Give each shot its own short `sce
"voice": {"voice_id": "leo", "language": "en", "speed": 1.0}, // pick per topic/language — see references/voices.md
"music": "epic cinematic orchestral, instrumental, no vocals",
"mix": {"music": 0.6, "voice": 1.25}, // audio balance — optional; these are the defaults (BGM ducks under the VO)
+ "caption_style": "white", // white (default: clean white subtitle) | paper (cream cut-out collage look)
"watermark": "Made with Atlas Cloud",
"beats": [
{
diff --git a/SKILL.zh.md b/SKILL.zh.md
index 204d284..310271e 100644
--- a/SKILL.zh.md
+++ b/SKILL.zh.md
@@ -116,6 +116,7 @@ Vox 拼贴的**样子**和**动效**是两件事、两步:
"voice": {"voice_id": "leo", "language": "en", "speed": 1.0}, // 按主题/语种挑 —— 见 references/voices.md
"music": "epic cinematic orchestral, instrumental, no vocals",
"mix": {"music": 0.6, "voice": 1.25}, // 音量平衡(可选;这是默认值,音乐在人声下自动让路)
+ "caption_style": "white", // white(默认:干净白字幕)| paper(奶油剪纸拼贴风)
"watermark": "Made with Atlas Cloud",
"beats": [
{
diff --git a/scripts/assemble.py b/scripts/assemble.py
index 8044a25..60f3ca0 100644
--- a/scripts/assemble.py
+++ b/scripts/assemble.py
@@ -51,6 +51,7 @@ def run(project_dir):
mix = doc.get("mix", {}) # per-project audio balance (optional)
music_vol = float(mix.get("music", 0.6)) # BGM level (was a fixed 0.9 — lowered so VO leads)
voice_vol = float(mix.get("voice", 1.25)) # narration boost before the duck + final mix
+ cap_style = doc.get("caption_style", "white") # white (default, clean) | paper (collage)
tmp = os.path.join(project_dir, "_seg")
os.makedirs(tmp, exist_ok=True)
@@ -106,10 +107,12 @@ def run(project_dir):
for bs in beat_spans:
beat = bs["beat"]
p = os.path.join(tmp, f"cap_{beat['id']}.png")
- kf = next((s["keyframe_path"] for s in (beat.get("shots") or [beat])
- if s.get("keyframe_path") and os.path.exists(s["keyframe_path"])), None)
- acc = text_overlay.accent_color(kf) if kf else None
- text_overlay.render_caption(beat["narration"], p, W, H, accent=acc)
+ acc = None
+ if cap_style == "paper": # only the paper style uses a per-beat keyline
+ kf = next((s["keyframe_path"] for s in (beat.get("shots") or [beat])
+ if s.get("keyframe_path") and os.path.exists(s["keyframe_path"])), None)
+ acc = text_overlay.accent_color(kf) if kf else None
+ text_overlay.render_caption(beat["narration"], p, W, H, accent=acc, style=cap_style)
cap_pngs.append(p)
wm_png = text_overlay.render_watermark(wm_text, os.path.join(tmp, "wm.png"), W, H)
diff --git a/scripts/text_overlay.py b/scripts/text_overlay.py
index eff2e01..7d26980 100644
--- a/scripts/text_overlay.py
+++ b/scripts/text_overlay.py
@@ -16,6 +16,8 @@ FONT_REG = [
"/Library/Fonts/Arial.ttf",
]
+CAPTION_STYLES = ("white", "paper")
+
def _font(paths, size):
for p in paths:
@@ -41,7 +43,8 @@ def _wrap(draw, text, fnt, max_w):
def accent_color(image_path, default=(214, 64, 42)):
"""Sample a vibrant color from a keyframe so the caption keyline travels with
- each film's palette (Mexican -> pink/teal, Tang -> vermilion...). Fallback default."""
+ each film's palette (Mexican -> pink/teal, Tang -> vermilion...). Fallback default.
+ Only the `paper` caption style uses this."""
try:
im = Image.open(image_path).convert("RGB").resize((80, 80)).quantize(colors=24).convert("RGB")
except Exception:
@@ -60,10 +63,15 @@ def accent_color(image_path, default=(214, 64, 42)):
return best or default
-def render_caption(text, out_path, W=1920, H=1080, margin_v=None, accent=None):
- """Cut-out paper caption: cream letters + dark-ink edge + soft shadow, NO band
- (never covers the video). `accent` (RGB) adds a per-beat colored keyline. Small
- size (like the old captions) so it doesn't occlude the collage."""
+def render_caption(text, out_path, W=1920, H=1080, margin_v=None, accent=None, style="white"):
+ """Bottom-centered caption. `style` picks the look (default 'white'):
+ white – plain white letters + dark edge + soft shadow, NO band. The clean,
+ legible subtitle look from the original Tang film. Never gaudy.
+ paper – cream cut-out paper letters + ink edge + soft shadow + optional per-beat
+ colored keyline (the collage-styled look; `accent` is used ONLY here).
+ Size is small (like the original captions) so it never occludes the collage."""
+ if style not in CAPTION_STYLES:
+ style = "white"
size = int(min(W, H) * 0.045)
if margin_v is None:
margin_v = int(H * 0.06)
@@ -73,26 +81,54 @@ def render_caption(text, out_path, W=1920, H=1080, margin_v=None, accent=None):
lines = _wrap(d0, text, fnt, int(W * 0.8))
lh = int(size * 1.3)
y0 = H - margin_v - lh * len(lines)
- pos = [((W - d0.textlength(ln, font=fnt)) / 2, y0 + i * lh, ln) for i, ln in enumerate(lines)]
+ # (x, y, text, width) per line
+ pos = [(round((W - d0.textlength(ln, font=fnt)) / 2), y0 + i * lh, ln,
+ d0.textlength(ln, font=fnt)) for i, ln in enumerate(lines)]
+
+ if style == "paper":
+ _draw_paper(img, pos, fnt, size, accent)
+ else:
+ _draw_white(img, pos, fnt, size)
+ img.save(out_path)
+ return out_path
+
+
+def _draw_white(img, pos, fnt, size):
+ """Clean white subtitle: white fill, dark keyline for legibility, soft shadow."""
+ ow = max(2, round(size * 0.08))
+ sh = Image.new("RGBA", img.size, (0, 0, 0, 0))
+ sd = ImageDraw.Draw(sh)
+ for x, y, t, _ in pos:
+ sd.text((x + 2, y + 3), t, font=fnt, fill=(0, 0, 0, 175),
+ stroke_width=ow, stroke_fill=(0, 0, 0, 175))
+ blended = Image.alpha_composite(img, sh.filter(ImageFilter.GaussianBlur(4)))
+ img.paste(blended, (0, 0))
+ d = ImageDraw.Draw(img)
+ for x, y, t, _ in pos:
+ d.text((x, y), t, font=fnt, fill=(255, 255, 255, 255),
+ stroke_width=ow, stroke_fill=(26, 20, 16, 235))
+
+
+def _draw_paper(img, pos, fnt, size, accent):
+ """Cream cut-out paper letters + ink edge + soft shadow + optional colored keyline."""
+ W, H = img.size
ow = max(3, round(size * 0.13)) # ink edge
- # soft shadow halo — keeps text legible over bright art, minimal darkening
- sh = Image.new("RGBA", (W, H), (0, 0, 0, 0))
+ sh = Image.new("RGBA", (W, H), (0, 0, 0, 0)) # soft shadow halo
sd = ImageDraw.Draw(sh)
- for x, y, t in pos:
+ for x, y, t, _ in pos:
sd.text((x + 3, y + 4), t, font=fnt, fill=(8, 6, 3, 190),
stroke_width=ow, stroke_fill=(8, 6, 3, 190))
- img = Image.alpha_composite(img, sh.filter(ImageFilter.GaussianBlur(5)))
+ blended = Image.alpha_composite(img, sh.filter(ImageFilter.GaussianBlur(5)))
+ img.paste(blended, (0, 0))
d = ImageDraw.Draw(img)
if accent: # per-beat colored keyline
a = tuple(accent[:3]) + (255,)
kw = max(4, round(size * 0.14))
- for x, y, t in pos:
+ for x, y, t, _ in pos:
d.text((x, y), t, font=fnt, fill=a, stroke_width=ow + kw, stroke_fill=a)
- for x, y, t in pos: # cream cut-out letters + ink edge
+ for x, y, t, _ in pos: # cream cut-out letters + ink edge
d.text((x, y), t, font=fnt, fill=(252, 246, 232, 255),
stroke_width=ow, stroke_fill=(32, 22, 18, 255))
- img.save(out_path)
- return out_path
def render_title(text, out_path, W=1080, H=1920, sub=None):
@@ -118,7 +154,7 @@ def render_title(text, out_path, W=1080, H=1920, sub=None):
def render_watermark(text, out_path, W=1920, H=1080):
- # same cut-out treatment as captions (no black box): cream text + ink edge
+ # cream text + ink edge (no black box), consistent across caption styles
img = Image.new("RGBA", (W, H), (0, 0, 0, 0))
d = ImageDraw.Draw(img)
size = int(min(W, H) * 0.022)
diff --git a/vox-director.skill b/vox-director.skill
index 45f1387..bff60eb 100644
Binary files a/vox-director.skill and b/vox-director.skill differ