SuperAPI AI Directory

video-stickfigure

Design & creation

View repository

Updated 10-16 09:35

About this skill

Stick Figure Image Generation Skill

🚨 Core Principles

Must use AI image generation! Drawing lines with PIL is prohibited!

Check standard: generated image file > 50KB


🔧 Image Generation Tool

Use the image-service skill:

python ~/.openclaw/skills/image-service/scripts/text_to_image.py "[prompt]" -r 9:16 -o stick1.png

📝 Prompt Template

Dark forest green background version (recommended · default)

minimalist chalk-style stick figure on dark green chalkboard background #3c5b45,
white chalk line art, simple 5-stroke drawing style,
[动作描述],
exaggerated pose, hand-drawn feel, chalk texture,
no shading, no gradient, stark contrast,
vertical composition 9:16, no text, no watermark

Pure black background version (alternative)

minimalist stick figure, pure black background #000000,
white line art only, simple 5-stroke drawing,
[动作描述],
exaggerated pose, no shading, no gradient, no gray,
stark contrast, cartoon style,
vertical composition 9:16, no text, no watermark

Selection advice:

  • Dark forest green version: has a blackboard texture, visually softer ✅ recommended
  • Pure black version: higher contrast, more minimalist

Action description + atmospheric elements (must be included!)

The stick figure cannot stand alone! Atmospheric elements must be added to set off the emotion!

Emotion/Concept Character action 🌟 Atmospheric elements (must add!)
Aging/Exhaustion person slumped over, tired posture + withered leaves falling, dim shadows, cracked ground
Withering/Dejection person wilting like a dying plant + dead tree nearby, falling petals, dark clouds
Upward/Growth person climbing stairs upward + sunlight rays from above, distant mountain peak, stars
Shouldering/Undertaking person lifting heavy weight overhead + storm clouds, rain drops, lightning in background
Looking far/Gazing into the distance person standing on cliff, hand over eyes + vast horizon, clouds below feet, sunrise glow
Accepting others/Tolerance person with arms wide open + small figures approaching, warm light rays, hearts floating
Pleasure/Joy person jumping with joy, arms raised + confetti, sparkles, fireworks in sky
Growth/Transformation person breaking out of shell + butterfly wings emerging, light beams, blooming flowers
Thinking/Contemplation person sitting cross-legged, hand on chin + floating question marks, gears, light bulb above head
Action/Running person running forward with determination + motion lines, wind effect, path stretching ahead

Prompt assembly formula

[基础模板] + [人物动作] + [氛围元素] + [后缀]

Example: aging scene

minimalist chalk-style stick figure on dark green chalkboard background #3c5b45,
white chalk line art, simple 5-stroke drawing style,
person slumped over tired posture aging feeling,
withered leaves falling around, dim shadows, cracked ground beneath,
exaggerated pose, hand-drawn feel, chalk texture,
no shading, no gradient, stark contrast,
vertical composition 9:16, no text, no watermark

Example: climbing stairs scene

minimalist chalk-style stick figure on dark green chalkboard background #3c5b45,
white chalk line art, simple 5-stroke drawing style,
person climbing stairs upward with determination,
sunlight rays streaming from above, distant mountain peak visible, glowing stars,
exaggerated pose, hand-drawn feel, chalk texture,
no shading, no gradient, stark contrast,
vertical composition 9:16, no text, no watermark

⚠️ Atmospheric element rules

  1. Must add - A stick figure image without atmospheric elements is too monotonous
  2. Match the emotion - Use dark elements for negative emotions, bright elements for positive emotions
  3. Not too many - 2-3 atmospheric elements are enough; too many will be cluttered
  4. Keep it simple - Atmospheric elements are also in chalk drawing style, do not make them realistic

🎨 HSV background unification processing (required!)

AI cannot precisely control colors! After image generation, the background color must be unified with code!

Processing script

import cv2
import numpy as np

def unify_background_hsv(input_path, output_path, target_hex="#3c5b45"):
    """
    用HSV范围替换统一背景色
    """
    img = cv2.imread(input_path)
    hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
    
    # 绿色系HSV范围(覆盖AI生成的各种绿色)
    lower = np.array([35, 20, 20])
    upper = np.array([85, 255, 255])
    
    # 创建掩码
    mask = cv2.inRange(hsv, lower, upper)
    
    # 目标颜色 BGR
    target_bgr = tuple(int(target_hex.lstrip('#')[i:i+2], 16) for i in (4, 2, 0))
    
    # 替换背景
    result = img.copy()
    result[mask > 0] = target_bgr
    
    cv2.imwrite(output_path, result)
    return output_path

# 批量处理
import glob
for f in glob.glob("stick*.png"):
    if "_unified" not in f:
        out = f.replace(".png", "_unified.png")
        unify_background_hsv(f, out)
        print(f"处理完成: {out}")

Command-line version

python3 << 'EOF'
import cv2
import numpy as np
import glob
import sys

target_hex = "#3c5b45"
target_bgr = tuple(int(target_hex.lstrip('#')[i:i+2], 16) for i in (4, 2, 0))

for f in glob.glob("stick*.png"):
    if "_unified" in f:
        continue
    img = cv2.imread(f)
    hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
    mask = cv2.inRange(hsv, np.array([35,20,20]), np.array([85,255,255]))
    result = img.copy()
    result[mask > 0] = target_bgr
    out = f.replace(".png", "_unified.png")
    cv2.imwrite(out, result)
    print(f"✅ {f} -> {out}")
EOF

✅ Checklist (all must pass!)

Before delivering images, must confirm:

Check item Standard If not passed
File size Each > 50KB Regenerate with AI
Image count Consistent with scene count Generate additional ones
Background color Unified as #3c5b45 Run HSV processing
Stick figure visible White lines clear Regenerate
# 快速检查文件大小
ls -la stick*_unified.png | awk '{if($5<50000) print "❌ "$9" 太小: "$5"B"; else print "✅ "$9": "$5"B"}'

📁 Output specifications

File Description
stick1.png, stick2.png, ... Original image generated by AI
stick1_unified.png, ... Unified background image after HSV processing

Subsequent processes only use *_unified.png files!


🚫 Common mistakes

Mistake Consequence Correct approach
Drawing lines with PIL The video looks like a test image Use image-service AI image generation
Skipping HSV processing Background colors vary in shade HSV unification must be performed
File <50KB Poor image quality Regenerate
Use the original image, not unified Background not unified Use only _unified.png
The stick figure has no atmospheric elements The image is monotonous and lacks impact Atmospheric elements must be added to the prompt