colorize
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseColorize
Colorize(上色)
Workflow
工作流程
- Collect the user's inputs: images, videos, or Live Photos. Use absolute paths.
- Resolve the skill directory and install dependencies once (see Requirements).
- Run with the inputs and an output path.
scripts/colorize.py - Wait for and
VALIDATION=PASS.OUTPUT_VIDEO=<absolute path> - Optionally extract a few frames with to check the look before replying.
ffmpeg - Return the output path and the settings used.
- 收集用户输入的图像、视频或 Live Photos。使用绝对路径。
- 确定 skill 目录并一次性安装依赖(参见“要求”)。
- 使用输入内容和输出路径运行 。
scripts/colorize.py - 等待 和
VALIDATION=PASS。OUTPUT_VIDEO=<absolute path> - 可选地使用 提取几帧,以在回复前检查效果。
ffmpeg - 返回输出路径和所使用的设置。
Quick Start
快速开始
bash
skill_dir=""
for base in "${AGENTS_HOME:-$HOME/.agents}" "${CLAUDE_HOME:-$HOME/.claude}" "${CODEX_HOME:-$HOME/.codex}"; do
if [ -d "$base/skills/colorize" ]; then
skill_dir="$base/skills/colorize"
break
fi
done
[ -n "$skill_dir" ] || { echo "colorize skill not found under ~/.agents, ~/.claude, or ~/.codex"; exit 1; }
python3 -m pip install -r "$skill_dir/scripts/requirements.txt"
python3 "$skill_dir/scripts/colorize.py" "/abs/path/photo.jpg" -o "$(pwd)/out/photo_colorize.mp4"If the agent already knows the directory containing this , use that as .
SKILL.mdskill_dirbash
skill_dir=""
for base in "${AGENTS_HOME:-$HOME/.agents}" "${CLAUDE_HOME:-$HOME/.claude}" "${CODEX_HOME:-$HOME/.codex}"; do
if [ -d "$base/skills/colorize" ]; then
skill_dir="$base/skills/colorize"
break
fi
done
[ -n "$skill_dir" ] || { echo "colorize skill not found under ~/.agents, ~/.claude, or ~/.codex"; exit 1; }
python3 -m pip install -r "$skill_dir/scripts/requirements.txt"
python3 "$skill_dir/scripts/colorize.py" "/abs/path/photo.jpg" -o "$(pwd)/out/photo_colorize.mp4"如果 Agent 已经知道包含此 的目录,则将其用作 。
SKILL.mdskill_dirInputs
输入
| Input | What happens |
|---|---|
Image ( | Static plate; the reveal lasts |
Video ( | Each source frame keeps moving; the reveal runs over the first |
| iPhone Live Photo | Pass the still ( |
| Android motion photo | Pass the |
| Several inputs | Rendered in order and joined into one MP4. Each input gets its own reveal. |
Use to ignore Live Photo or motion photo video and animate only the still.
--still| 输入 | 处理方式 |
|---|---|
图像( | 静态画面;揭示效果持续 |
视频( | 每个源画面都会继续运动;揭示效果在前 |
| iPhone Live Photo | 传入静态图像( |
| Android motion photo | 传入 |
| 多个输入 | 按顺序渲染并拼接为一个 MP4。每个输入都会获得独立的揭示效果。 |
使用 可忽略 Live Photo 或 motion photo 中的视频,仅为静态图像添加动画。
--stillCommon Commands
常用命令
bash
undefinedbash
undefinedOne photo, 2 s reveal + 0.5 s hold
One photo, 2 s reveal + 0.5 s hold
python3 "$skill_dir/scripts/colorize.py" photo.jpg --hold 0.5 -o out/photo.mp4
python3 "$skill_dir/scripts/colorize.py" photo.jpg --hold 0.5 -o out/photo.mp4
Live Photo (IMG_0001.MOV next to it is picked up)
Live Photo (IMG_0001.MOV next to it is picked up)
python3 "$skill_dir/scripts/colorize.py" IMG_0001.HEIC -o out/live.mp4
python3 "$skill_dir/scripts/colorize.py" IMG_0001.HEIC -o out/live.mp4
Video: slower 3 s reveal, keep the first 6 s
Video: slower 3 s reveal, keep the first 6 s
python3 "$skill_dir/scripts/colorize.py" clip.mov --duration 3 --max-length 6 -o out/clip.mp4
python3 "$skill_dir/scripts/colorize.py" clip.mov --duration 3 --max-length 6 -o out/clip.mp4
Several images and videos as one vertical reel
Several images and videos as one vertical reel
python3 "$skill_dir/scripts/colorize.py" a.jpg b.heic c.mov --size 1080x1920 -o out/reel.mp4
python3 "$skill_dir/scripts/colorize.py" a.jpg b.heic c.mov --size 1080x1920 -o out/reel.mp4
Stronger spin and a little more glow
Stronger spin and a little more glow
python3 "$skill_dir/scripts/colorize.py" photo.jpg --set angle=0.09 --set bloom=0.7 -o out/strong.mp4
undefinedpython3 "$skill_dir/scripts/colorize.py" photo.jpg --set angle=0.09 --set bloom=0.7 -o out/strong.mp4
undefinedOptions
选项
| Option | Default | Meaning |
|---|---|---|
| | Output MP4 path. |
| | Reveal length in seconds. |
| | Images only: seconds to hold the settled frame. |
| | Output frame rate. |
| first input's aspect, long edge ≤ | Force output size; other inputs are center-cropped to it. |
| | Long-edge cap when |
| full clip | Videos: keep at most this many seconds. |
| off | Ignore Live Photo / motion photo video. |
| off | Drop audio. |
| — | Override one effect parameter (repeatable). |
| — | Override several effect parameters. |
| | x264 quality; lower is larger and sharper. |
| 选项 | 默认值 | 含义 |
|---|---|---|
| | 输出 MP4 的路径。 |
| | 揭示效果的持续时间,单位为秒。 |
| | 仅适用于图像:保持稳定画面的时间,单位为秒。 |
| | 输出帧率。 |
| 首个输入的宽高比,长边不超过 | 强制设置输出尺寸;其他输入会居中裁剪为相同尺寸。 |
| | 未设置 |
| 完整片段 | 视频最多保留的时长,单位为秒。 |
| 关闭 | 忽略 Live Photo 或 motion photo 中的视频。 |
| 关闭 | 移除音频。 |
| — | 覆盖单个效果参数,可重复使用。 |
| — | 覆盖多个效果参数。 |
| | x264 质量;数值越低,文件越大且越清晰。 |
Effect Parameters
效果参数
The defaults were fitted to the Jianying effect stack on static photos. Useful knobs for :
--set| Key | Default | Effect |
|---|---|---|
| | Spin-blur arc in radians; larger is stronger, the sign sets direction. Decays to zero. |
| | Final width of the sharp center disc; larger settles the edges sooner. |
| | Horizontal motion-blur strength; decays to zero. |
| | Blur decay curve; larger fades faster. |
| | Speed of the color sweep. |
| | Softness of the color/mono boundary. |
| | Soft glow and radial light-ray strength. |
| | Residual softening; |
| | Final saturation. |
| | Spin center in UV (y up). |
默认值已针对静态照片适配剪映(Jianying)效果堆栈。可使用 调整以下参数:
--set| 键 | 默认值 | 效果 |
|---|---|---|
| | 旋转模糊的弧度;值越大效果越强,符号决定方向,并逐渐衰减至零。 |
| | 最终清晰中心圆盘的宽度;值越大,边缘越早稳定。 |
| | 水平动感模糊强度,逐渐衰减至零。 |
| | 模糊衰减曲线;值越大,模糊消退越快。 |
| | 色彩扫入的速度。 |
| | 色彩与单色区域的边界柔和度。 |
| | 柔和辉光和径向光线的强度。 |
| | 残留柔化程度; |
| | 最终饱和度。 |
| | UV 坐标系中的旋转中心(y 轴向上)。 |
Behavior
行为
- Renders on the GPU with OpenGL 3.3 through (falls back to EGL on headless Linux) and encodes H.264
modernglBT.709 MP4 withyuv420p.ffmpeg - Output follows the first input's aspect ratio and orientation, including rotation metadata on phone videos.
- HDR (HLG/PQ) videos are tone-mapped to SDR when has
ffmpeg.zscale - HEIC/AVIF stills need , macOS
pillow-heif, or ansipswith HEIF support.ffmpeg - When any input has audio, every segment carries an AAC track (silence for images) so joined clips stay in sync.
- Videos shorter than get a compressed reveal that still ends fully settled.
--duration - Prints after checking the output's size, duration, and audio with
VALIDATION=PASS.ffprobe
- 通过 使用 OpenGL 3.3 在 GPU 上渲染(在无头 Linux 上回退到 EGL),并使用
moderngl编码为 H.264ffmpegBT.709 MP4。yuv420p - 输出内容遵循首个输入的宽高比和方向,包括手机视频中的旋转元数据。
- 当 包含
ffmpeg时,HDR(HLG/PQ)视频会被色调映射为 SDR。zscale - HEIC/AVIF 静态图像需要 、macOS
pillow-heif,或支持 HEIF 的sips。ffmpeg - 当任意输入包含音频时,每个片段都会带有 AAC 音轨(图像使用静音音轨),从而使拼接后的片段保持同步。
- 短于 的视频会压缩揭示过程的时长,同时确保最终完全稳定。
--duration - 使用 检查输出的尺寸、时长和音频后,会打印
ffprobe。VALIDATION=PASS
Requirements
要求
- Python 3.9+ with ,
numpy,moderngl(Pillow); optionalscripts/requirements.txtpillow-heif - and
ffmpegonffprobePATH - A GPU or driver with OpenGL 3.3 (macOS, Windows, desktop Linux, or Linux with EGL)
On macOS, if has to build from source: .
modernglCXXFLAGS='-std=c++11' python3 -m pip install moderngl- Python 3.9+,并安装 、
numpy、moderngl(Pillow);可选安装scripts/requirements.txtpillow-heif - 和
ffmpeg已添加到ffprobePATH - 支持 OpenGL 3.3 的 GPU 或驱动程序(macOS、Windows、桌面 Linux,或带 EGL 的 Linux)
在 macOS 上,如果 必须从源代码构建:
modernglbash
CXXFLAGS='-std=c++11' python3 -m pip install moderngl