qwen_agent/skills_developing/z-card-image/references/poster-3-4.md
2026-03-17 21:55:10 +08:00

81 lines
2.7 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.

# image-3-4 模板规范
比例3:4 | 尺寸900×1200 | 用途:小绿书 / 公众号 / 小红书通用封面
## 渲染命令
```bash
python3 skills/z-card-image/scripts/render_card.py \
--template poster-3-4 \
--out tmp/card.png \
--line1 "OpenClaw" \
--line2 "有两层" \
--line3 "model 配置" \
--highlight "#22a854" \
--bg "#e6f5ef" \
--footer "公众号 · 你的名字" \
--icon {agent_dir}/dataset/icon.[png/jpg]
```
## 参数说明
| 参数 | 默认值 | 说明 |
|------|--------|------|
| `--line1` | 空 | 第一行文字 |
| `--line2` | 空 | 第二行文字(空则隐藏)|
| `--line3` | 空 | 第三行文字(空则隐藏)|
| `--hl1` | 关闭 | 整行高亮:第一行 |
| `--hl2` | 关闭 | 整行高亮:第二行 |
| `--hl3` | 关闭 | 整行高亮:第三行 |
| `--highlight-words` | 空 | 按词高亮,逗号分隔,如 `OpenClaw,GPT-5.4`(跨行生效)|
| `--highlight` | `#22a854` | 高亮/强调色 |
| `--bg` | `#e6f5ef` | 背景色 |
| `--footer` | `公众号 · 早早集市` | 底部文字 |
| `--icon` | 自动判断 | 顶部图标路径,不传则按内容自动选 |
## icon
默认使用:
`{agent_dir}/dataset/icon.[png/jpg]`
显式传 `--icon {agent_dir}/dataset/icon.[png/jpg]`
## 高亮文字处理规则
**两种高亮方式,按需选择:**
### 1. 整行高亮(`--hl1` / `--hl2` / `--hl3`
整行文字渲染为高亮色。适合"某一行是关键句"的场景。
> 示例:第二行要高亮
> → `--line1 "GPT-5.4 发布了" --line2 "能控电脑" --hl2`
### 2. 按词高亮(`--highlight-words`
在任意行中,将指定词语渲染为高亮色,其余文字保持黑色。适合"某几个关键词"的场景。
> 示例:高亮 OpenClaw 和 GPT-5.4
> → `--line1 "GPT-5.4 最适合" --line2 "OpenClaw 使用" --highlight-words "GPT-5.4,OpenClaw"`
**优先级规则(有歧义时):**
- 用户说「高亮第X行」→ 用 `--hlX`
- 用户说「高亮某个词/某几个词」→ 用 `--highlight-words`
- 两者可以同时使用
- 若用户无明确要求,默认将最关键词/句用 `--highlight-words` 标出
| 位置 | 最多字数 | 说明 |
|------|---------|------|
| 每行line1/2/3 | **6~7 个汉字** / **10~12 个英文字符** | 字号 108px可用宽 720px |
| 三行合计 | **≤ 20 字** | 超出则横向溢出,无法使用 |
> 用户文案超出时,先帮忙拆分/缩写到上限内,再渲染,不要直接塞入模板。
## 配图选取原则
| 条件 | 使用图标 | 文件 |
|------|---------|------|
| 任意行含 `openclaw`(不区分大小写) | OpenClaw 小龙虾 | `assets/icons/openclaw-logo.svg` |
| 其他(默认) | 博客站 logo灰色 | `assets/icons/zzclub-logo-gray.svg` |