gif-analyzer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGIF Analyzer
GIF 分析工具
Analyze animated GIFs by extracting frames and interpreting them as sequential video.
通过提取帧并将其解读为连续视频,来分析GIF动图。
Quick Start
快速开始
When the user uses :
/gifPattern 1: Basic analysis
/gif ./animation.gifPattern 2: With specific request
/gif ./animation.gif describe what happens step by step
/gif ./demo.gif what is the character doing?
/gif ./screen.gif summarize this screen recording当用户使用命令时:
/gif模式1:基础分析
/gif ./animation.gif模式2:带特定请求
/gif ./animation.gif 逐步描述发生的内容
/gif ./demo.gif 这个角色在做什么?
/gif ./screen.gif 总结这段屏幕录制内容Workflow
工作流程
Step 1: Parse User Input
步骤1:解析用户输入
Extract from the user's message:
- GIF path: The file path immediately after
/gif - User request (optional): Any text after the GIF path
Example parsing:
- Input:
/gif ./demo.gif explain the animation - GIF path:
./demo.gif - User request:
explain the animation
从用户消息中提取:
- GIF路径:紧跟在后的文件路径
/gif - 用户请求(可选):GIF路径之后的任何文本
解析示例:
- 输入:
/gif ./demo.gif explain the animation - GIF路径:
./demo.gif - 用户请求:
explain the animation
Step 2: Extract Frames
步骤2:提取帧
bash
python3 ~/.claude/skills/gif-analyzer/extract_gif_frames.py <gif_path> --output-dir /tmp/gif_frames_analysisOptions for long GIFs:
bash
python3 ~/.claude/skills/gif-analyzer/extract_gif_frames.py <gif_path> --max-frames 30 --skip 2bash
python3 ~/.claude/skills/gif-analyzer/extract_gif_frames.py <gif_path> --output-dir /tmp/gif_frames_analysis针对长GIF的选项:
bash
python3 ~/.claude/skills/gif-analyzer/extract_gif_frames.py <gif_path> --max-frames 30 --skip 2Step 3: Read Metadata
步骤3:读取元数据
Check for:
gif_metadata.json- Total frames and duration
- Individual frame timestamps
- Resolution and loop information
查看获取以下信息:
gif_metadata.json- 总帧数和时长
- 单帧时间戳
- 分辨率和循环信息
Step 4: View and Analyze Frames
步骤4:查看并分析帧
View frames in order: , , etc.
frame_001.pngframe_002.pngCRITICAL: Treat frames as a continuous video sequence:
- Frame 001 = START of the animation
- Frame numbers increase in TIME ORDER
- Consecutive frames show MOTION/CHANGE over time
按顺序查看帧:、等。
frame_001.pngframe_002.png重要提示:将帧视为连续的视频序列:
- Frame 001 = 动画起始点
- 帧号按时间顺序递增
- 连续帧展示了随时间变化的动态/内容变更
Step 5: Respond to User
步骤5:响应用户
If user provided a specific request, focus on answering that.
Otherwise, provide a general analysis of the GIF content.
如果用户有特定请求,重点回应该请求。
否则,提供对GIF内容的常规分析。
Script Options
脚本选项
| Option | Description | Default |
|---|---|---|
| Output directory | |
| Max frames to extract | 50 |
| Extract every Nth frame | 1 (all frames) |
| 选项 | 描述 | 默认值 |
|---|---|---|
| 输出目录 | |
| 最大提取帧数 | 50 |
| 每隔N帧提取一次 | 1(提取所有帧) |
Frame Analysis Guidelines
帧分析指南
- Temporal Awareness: Frame 001 is the beginning
- Motion Detection: Compare adjacent frames to identify movement
- Key Frames: Identify significant moments (start, middle, end)
- Loop Points: Note if the animation appears to loop
- Duration Context: Use timestamp info to understand pacing
- 时间感知:Frame 001是动画的开始
- 动态检测:对比相邻帧以识别运动
- 关键帧:识别重要时刻(开始、中间、结束)
- 循环点:注意动画是否存在循环
- 时长上下文:使用时间戳信息了解节奏
Output Format
输出格式
📹 **GIF Analysis: [filename]**
**Overview:**
[1-2 sentence summary]
**Timeline:**
- [0.0s - 0.5s] Frame 1-5: [Description]
- [0.5s - 1.0s] Frame 6-10: [Description]
...
**[Answer to user's specific question if provided]**📹 **GIF分析:[文件名]**
**概述:**
[1-2句话总结]
**时间线:**
- [0.0s - 0.5s] 帧1-5:[描述]
- [0.5s - 1.0s] 帧6-10:[描述]
...
**[如果有用户特定问题,此处为答案]**Troubleshooting
故障排除
- Pillow not found:
pip install Pillow - Too many frames: Use or higher
--skip 2 - Large output: Use
--max-frames 20
- 未找到Pillow:
pip install Pillow - 帧数过多:使用或更高值
--skip 2 - 输出文件过大:使用
--max-frames 20