TikTok Text Overlay

v1.1.0

Adds TikTok-style text overlays to images and videos with styled fonts, backgrounds, strokes, and timed animations.

0· 288·2 current·2 all-time
byLi Wei@xmuweili

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for xmuweili/tiktok-overlay.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "TikTok Text Overlay" (xmuweili/tiktok-overlay) from ClawHub.
Skill page: https://clawhub.ai/xmuweili/tiktok-overlay
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Required binaries: python3
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Canonical install target

openclaw skills install xmuweili/tiktok-overlay

ClawHub CLI

Package manager switcher

npx clawhub@latest install tiktok-overlay
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the included code and instructions: the two Python modules implement image and video text overlays. Declared requirement (python3) and pip packages (Pillow, moviepy) are what you'd expect for this functionality. The code uses local files and PIL/moviepy APIs only; no unexpected network endpoints or unrelated services are required.
Instruction Scope
SKILL.md instructs the agent to install Pillow/moviepy and to call the included functions or CLI; the runtime steps operate on input image/video files and produce local output files. The instructions do not ask the agent to read unrelated system files, environment variables, or to send data externally.
Install Mechanism
Installation is via Python packages (Pillow, moviepy) — a common, traceable method. No arbitrary URL downloads or extracted archives are used. Note: moviepy typically requires an external ffmpeg binary at runtime; ffmpeg is not declared as a required binary in the metadata, so video functionality may fail unless ffmpeg is present on the host.
Credentials
The skill requests no environment variables, credentials, or config paths. All file and binary access in the code (opening images/videos, reading system font paths) is proportional to overlay functionality. One minor quirk: FONT_MAP points to macOS system font paths, so font selection may behave differently on non-macOS systems (fallback behavior should be expected).
Persistence & Privilege
The skill is not always-enabled and does not request elevated or persistent platform privileges. disable-model-invocation is false (the agent may invoke the skill autonomously) — this is the platform default and not a specific red flag here.
Assessment
This skill appears internally consistent: it implements local image/video overlay functionality and asks only for Python and standard packages (Pillow, moviepy). Before installing, consider: (1) moviepy needs ffmpeg (install separately) — the skill metadata does not declare ffmpeg; (2) the code references macOS font paths so fonts may differ on Linux/Windows; (3) run the skill in a safe environment (or review the included Python files) if you want to be extra cautious. No credentials or network endpoints are required by the skill, so there is no obvious exfiltration behavior present.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

🎵 Clawdis
Binspython3

Install

uv
imagevk97206h4texdxayknvwmbq1z8d82hwa8latestvk97206h4texdxayknvwmbq1z8d82hwa8mediavk97206h4texdxayknvwmbq1z8d82hwa8tiktokvk97206h4texdxayknvwmbq1z8d82hwa8videovk97206h4texdxayknvwmbq1z8d82hwa8
288downloads
0stars
2versions
Updated 1mo ago
v1.1.0
MIT-0

TikTok Text Overlay Skill

You are a TikTok-style text overlay tool. You add styled text overlays to images and videos, replicating the look and feel of TikTok's built-in text editor.

Setup

The overlay scripts live in {baseDir}:

  • {baseDir}/tiktok_overlay.py — image overlay engine
  • {baseDir}/tiktok_video_overlay.py — video overlay engine (uses moviepy)

Before using, ensure dependencies are installed:

pip3 install Pillow moviepy

Available Styles

StyleValueDescription
ClassicclassicClean bold sans-serif (Arial Bold)
TypewritertypewriterMonospace typewriter look
HandwritinghandwritingCasual handwriting font
NeonneonRounded bold with glow effect
SerifserifTraditional serif (Georgia)
StrongstrongExtra bold impact style
ComiccomicPlayful comic sans style

Background Styles

StyleValueDescription
NonenoneNo background, text only
HighlighthighlightPer-line rounded highlight (TikTok default)
Full BGfull_bgSingle rounded rectangle behind all text
LetterletterPer-line tight highlight

Image Overlay

Use {baseDir}/tiktok_overlay.py for images:

import sys
sys.path.insert(0, "{baseDir}")
from tiktok_overlay import overlay_text, overlay_texts, TextOverlay

# Single text — save to file
overlay_text("input.jpg", "Your text here", "output.jpg",
    style="classic", font_size=48, stroke_width=5, bg_style="none")

# Single text — return PIL Image (omit output_path)
result = overlay_text("input.jpg", "Your text here",
    style="strong", font_size="large", text_color="coral")

# Multiple overlays — TextOverlay objects
overlay_texts("input.jpg", [
    TextOverlay("Top text", position="top", style="classic", stroke_width=4),
    TextOverlay("Bottom", position="bottom", text_color="red"),
], "output.jpg")

# Multiple overlays — dicts (no import needed)
overlay_texts("input.jpg", [
    {"text": "Top text", "position": "top", "style": "strong", "stroke_width": 5},
    {"text": "Bottom", "position": "bottom", "text_color": "coral"},
], "output.jpg")

# Multiple overlays — (text, kwargs) tuples
overlay_texts("input.jpg", [
    ("Top text", {"position": "top", "stroke_width": 5}),
    ("Bottom", {"position": "bottom", "text_color": "red"}),
], "output.jpg")

Flexible Inputs

All parameters accept multiple formats:

Input source — file path, PIL Image, numpy array, or bytes:

overlay_text("photo.jpg", "Hello", "out.jpg")          # path
overlay_text(pil_image, "Hello", "out.jpg")             # PIL Image
overlay_text(numpy_array, "Hello", "out.jpg")           # numpy
overlay_text(image_bytes, "Hello", "out.jpg")           # bytes

Output — file path to save, or None to return PIL Image:

overlay_text("photo.jpg", "Hello", "out.jpg")           # saves file
result = overlay_text("photo.jpg", "Hello")             # returns PIL Image

Colors — hex, short hex, hex+alpha, named, RGB tuple, RGBA tuple:

text_color="#FF0000"          # hex
text_color="#F00"             # short hex
text_color="#FF000080"        # hex with alpha
text_color="red"              # named (all CSS/PIL colors)
text_color=(255, 0, 0)        # RGB tuple
text_color=(255, 0, 0, 128)   # RGBA tuple

Font size — int pixels, string with unit, or named size:

font_size=48                  # pixels
font_size="48px"              # string with unit
font_size="small"             # 32px
font_size="medium"            # 48px
font_size="large"             # 64px
font_size="xl"                # 80px
font_size="title"             # 72px
font_size="caption"           # 28px

Style — string or enum:

style="classic"               # string
style="strong"
from tiktok_overlay import TikTokStyle
style=TikTokStyle.CLASSIC     # enum

Position — named, compound, pixel, percentage, or dict:

position="top"                # named
position="bottom-left"        # compound
position=(100, 200)           # pixel coordinates
position=("50%", "80%")       # percentage of image size
position={"x": "10%", "y": "top"}  # dict with mixed

Opacity — float, int, or percentage string:

bg_opacity=0.6                # float 0-1
bg_opacity=153                # int 0-255
bg_opacity="60%"              # percentage string

Max width ratio — float or percentage string:

max_width_ratio=0.85          # float
max_width_ratio="85%"         # percentage string

CLI

python3 {baseDir}/tiktok_overlay.py <input_image> "<text>" [output_image] [style]

Output path is optional — defaults to input_overlay.ext.

Video Overlay

Use {baseDir}/tiktok_video_overlay.py for videos. Supports timed text and fade in/out:

import sys
sys.path.insert(0, "{baseDir}")
from tiktok_video_overlay import overlay_video_text, overlay_video_texts, VideoTextOverlay

# Single text on entire video
overlay_video_text("input.mp4", "Hello!", "output.mp4",
    style="classic", font_size=52, stroke_width=5)

# Multiple timed texts
overlay_video_texts("input.mp4", [
    VideoTextOverlay("Appears 0-3s", t_start=0, t_end=3,
        fade_in=0.5, fade_out=0.5,
        style="classic", position="top", font_size=48, stroke_width=4),
    VideoTextOverlay("Appears 2-5s", t_start=2, t_end=5,
        style="strong", position="center", font_size=56,
        text_color="tomato", stroke_width=5, bg_style="none"),
    VideoTextOverlay("Always visible",
        position="bottom", font_size=40, bg_style="highlight"),
], "output.mp4")

CLI

python3 {baseDir}/tiktok_video_overlay.py <input_video> "<text>" <output_video> [style]

Key Parameters

ParameterAcceptsDefaultDescription
input_sourcepath, PIL Image, numpy array, bytesImage to overlay
textstrThe text to overlay
output_pathpath or NoneNoneSave path; None returns PIL Image
stylestr, TikTokStyle, NoneclassicFont style
font_sizeint, str ("48px", "large")48Font size
text_colorhex, named, rgb/rgba tuple#FFFFFFText color
bg_stylestrhighlightBackground style
bg_colorhex, named, rgb/rgba tuple#000000Background color
bg_opacityfloat 0-1, int 0-255, str "60%"0.6Background opacity
positionstr, (x,y), ("x%","y%"), dictcenterPosition
alignmentstrcenterText alignment: left/center/right
stroke_widthint0Outline thickness (4-6 for TikTok look)
stroke_colorhex, named, rgb/rgba tuple#000000Outline color
max_width_ratiofloat or str "85%"0.85Max text width as ratio of image width

Video-only Parameters

ParameterTypeDefaultDescription
t_startfloat or NoneNoneStart time in seconds
t_endfloat or NoneNoneEnd time in seconds
fade_infloat0.0Fade in duration (seconds)
fade_outfloat0.0Fade out duration (seconds)

Tips

  • For the classic TikTok outlined text look, use bg_style="none" with stroke_width=5.
  • For the TikTok highlight look, use bg_style="highlight" with bg_opacity=0.6.
  • Word wrapping is automatic based on max_width_ratio.
  • Compound positions like "top-left" and "bottom-right" are supported.
  • All CSS/PIL named colors work: "red", "coral", "dodgerblue", "gold", etc.
  • Uses macOS system fonts as TikTok-style substitutes. Works out of the box on macOS.

Comments

Loading comments...