Generate a 1080p particle animation video from any logo or image. Pure local processing — Python + FFmpeg, no API key needed.
Trigger this skill when the user wants to:
brew install ffmpeg)uv run --with)Ask the user for (if not already provided):
output.mp4uv run --with numpy --with Pillow python3 <skill-path>/scripts/particle_logo.py <input_image> <output.mp4> [--size WxH] [--duration N] [--particles N] [--fps 30|60] [--bg COLOR] [--no-audio]
The script path is scripts/particle_logo.py relative to this SKILL.md.
Parameters:
| Parameter | Default | Description | |
|---|---|---|---|
| ----------- | --------- | ------------- | |
--size WxH | auto | Video size (e.g. 1920x1080, 1080x1920, 1080) | |
--duration N | 6.0 | Duration in seconds (range 3-30) | |
--particles N | 10000 | Particle count (range 1000-50000). More = finer detail but slower | |
| `--fps 30\ | 60` | 60 | Frame rate. 30 = smaller file, 60 = smoother |
--bg COLOR | auto | Background color: auto / white / black / #RRGGBB | |
--no-audio | off | Skip audio synthesis, output video only |
Examples:
# Auto size (preserves image aspect ratio)
uv run --with numpy --with Pillow python3 <skill-path>/scripts/particle_logo.py logo.png output.mp4
# Force specific size
uv run --with numpy --with Pillow python3 <skill-path>/scripts/particle_logo.py logo.png output.mp4 --size 1920x1080
# Custom duration and particles
uv run --with numpy --with Pillow python3 <skill-path>/scripts/particle_logo.py logo.png output.mp4 --duration 10 --particles 20000
# Fast preview (fewer particles, lower fps, no audio)
uv run --with numpy --with Pillow python3 <skill-path>/scripts/particle_logo.py logo.png output.mp4 --particles 3000 --fps 30 --no-audio
# Black background, portrait video
uv run --with numpy --with Pillow python3 <skill-path>/scripts/particle_logo.py logo.png output.mp4 --bg black --size 1080x1920
Check that:
Auto BG color and a non-zero targets countIf targets is 0 or the file is too small, see Troubleshooting below.
| Image type | Background | Foreground mask |
|---|---|---|
| ------------ | ------------ | ----------------- |
| Light background (white/gray) | Sampled from 4 corners | Otsu threshold on color distance |
| Dark background | Sampled from 4 corners | Otsu threshold on color distance |
| Transparent PNG (RGBA) | Forced to white | Alpha channel directly |
Size auto-detection (when --size is not given):
| Property | Value |
|---|---|
| ---------- | ------- |
| Duration | 6 seconds (configurable 3-30s via --duration) |
| FPS | 60 (or 30 via --fps) |
| Codec | H.264, CRF 18 |
| Audio | AAC 192k, synthesized build-up music (disable via --no-audio) |
| Particles | 10,000 (configurable 1k-50k via --particles) |
| Convergence | ~58% duration particle build → ding → logo reveal |
| Symptom | Cause | Fix |
|---|---|---|
| --------- | ------- | ----- |
| File ~0.2 MB, all black | Particle color == background (e.g., black icon on transparent → black bg) | Should be auto-fixed; if not, check that the image has an alpha channel |
targets: 0 error | No foreground pixels detected | Image may have very low contrast; not currently supported |
ffmpeg: command not found | FFmpeg not installed | brew install ffmpeg |
| Very slow (>5 min) | Too many target pixels (>500k) | Use a simpler/smaller logo |
共 1 个版本