Files
EmbeddedAnimPacker/README.md
Bairan.Zhang 8b785616d8 feat: add interactive configuration menu
Running without a GIF argument (or with -i/--interactive) now launches a
questionary-based menu that selects a source GIF from the current directory
and configures every conversion parameter before running. Passing a GIF on
the command line behaves exactly as before.

- extract a unified run_conversion(ConversionConfig) pipeline shared by the
  CLI and the menu, removing the duplicated convert loop in main()
- make the gif positional optional and add -i/--interactive
- import questionary lazily inside the menu so plain CLI usage gains no hard
  dependency, with a clear install hint when it is missing
- add __version__ / --version (0.2.0) and document the menu in README/AGENTS

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 14:47:26 +08:00

55 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# EmbeddedAnimPacker
把 GIF 动画拆成 PNG 帧,并逐帧调用 LVGL 的 `LVGLImage.py` 生成 BIN 文件。
## 使用
建议先创建并启用 Python 虚拟环境:
```bash
python3 -m venv .venv
. .venv/bin/activate
```
然后安装依赖Pillow 用于读取 GIFquestionary 用于交互式菜单):
```bash
python3 -m pip install -r requirements.txt
```
## 交互式菜单
不带任何参数运行,会进入交互式菜单:可以从当前目录选择源 GIF、逐项配置参数最后确认并执行转换
```bash
python3 EmbeddedAnimPacker.py
```
也可以用 `-i` / `--interactive` 显式进入菜单。菜单仅在进入时才需要 `questionary`;纯命令行用法不依赖它。
## 命令行
直接传入 GIF 文件即可(行为与以前一致):
```bash
python3 EmbeddedAnimPacker.py boot.gif
```
默认会调用 `lvgl/scripts/LVGLImage.py`,输出到 `littlefs/anim`
常用参数:
```bash
python3 EmbeddedAnimPacker.py boot.gif \
--lvgl-dir ./lvgl \
--output-dir ./littlefs/anim \
--cf RGB565 \
--compress RLE
```
保留中间 PNG 帧:
```bash
python3 EmbeddedAnimPacker.py boot.gif --keep-frames ./frames
```