← 返回 Skills 市场
663
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install lh-html-to-image
功能描述
Convert HTML+CSS into PNG images via Chrome headless for accurate text layouts like covers, posters, and info cards at zero API cost.
使用说明 (SKILL.md)
HTML to Image
Generate images from HTML+CSS using Chrome headless screenshots. Ideal for covers, posters, info cards, and any text-heavy visual content. Zero API cost, 100% accurate text rendering.
Use Cases
- ✅ Cover images (title + subtitle + tags)
- ✅ Info cards (data display, comparison charts)
- ✅ Text layout images (quote cards, highlight cards)
- ❌ Illustrations, photos (use an AI image generation tool)
Workflow
Step 1: Write HTML
Create an HTML file with inline CSS:
\x3C!DOCTYPE html>
\x3Chtml>
\x3Chead>
\x3Cmeta charset="utf-8">
\x3Cstyle>
body {
width: 1080px;
height: 1440px; /* 3:4 portrait */
margin: 0;
overflow: hidden;
font-family: -apple-system, "PingFang SC", "Noto Sans SC", sans-serif;
}
\x3C/style>
\x3C/head>
\x3Cbody>
\x3C!-- Your content here -->
\x3C/body>
\x3C/html>
Step 2: Chrome Headless Screenshot
# macOS
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
--headless=new \
--disable-gpu \
--screenshot="output.png" \
--window-size=1080,1440 \
--hide-scrollbars \
--force-device-scale-factor=2 \
"file:///absolute/path/to/your.html"
# Linux (auto-detect chrome/chromium)
google-chrome --headless=new --disable-gpu \
--screenshot="output.png" \
--window-size=1080,1440 \
--hide-scrollbars \
"file:///absolute/path/to/your.html"
Chrome path can be overridden via CHROME_PATH environment variable.
Common Sizes
| Purpose | Width×Height | Ratio |
|---|---|---|
| Portrait cover | 1080×1440 | 3:4 |
| Square cover | 1080×1080 | 1:1 |
| Widescreen cover | 1920×1080 | 16:9 |
| Social media banner | 1280×720 | 16:9 |
Tips
- Chrome GPU error logs can be safely ignored
- Use
--force-device-scale-factor=2for retina/high-DPI output (doubles pixel dimensions) - Use
--force-device-scale-factor=1for exact pixel dimensions - CJK fonts: PingFang SC (macOS built-in), Noto Sans SC (Linux, install via
apt install fonts-noto-cjk) - For complex layouts, test in a regular browser first, then screenshot
安全使用建议
This skill is instruction-only and simply documents how to use your local Chrome/Chromium to capture screenshots of HTML. Before installing/use: (1) ensure Chrome/Chromium is installed on the machine where the agent will run (SKILL.md assumes it but the metadata didn't list it); (2) confirm the CHROME_PATH you want to use (the doc mentions it but doesn't declare it as required); (3) be careful what HTML files you pass—the command reads local file:/// paths, so avoid handing it sensitive files; (4) on headless servers you may need extra OS dependencies or sandbox flags and to install any required fonts (the doc mentions Noto CJK for CJK text); (5) because the skill is instruction-only, it won't install software itself — you (or the operator) must provide Chrome and any fonts. If you need the agent to run this autonomously, ensure the runtime environment has Chrome, correct file permissions, and that you trust the agent to access only intended files.
功能分析
Type: OpenClaw Skill
Name: lh-html-to-image
Version: 1.0.1
The skill bundle is benign. It provides instructions for generating images from HTML using Chrome headless screenshots, a legitimate and common task. The `SKILL.md` file contains shell commands to execute Chrome, which is a powerful capability, but its use is directly aligned with the stated purpose. There is no evidence of intentional harmful behavior, data exfiltration, persistence mechanisms, or prompt injection attempts against the AI agent. Potential vulnerabilities related to input sanitization for the HTML content or file paths would lie in the OpenClaw agent's implementation, not in the skill's definition itself.
能力评估
Purpose & Capability
The skill's name/description (HTML→PNG via Chrome headless) matches the runtime instructions. Minor mismatch: the skill metadata declares no required binaries, but the instructions clearly require a local Chrome/Chromium binary to be installed.
Instruction Scope
SKILL.md stays on-topic: it tells the agent how to build HTML/CSS and run Chrome headless against a local file URL. It does not request unrelated files, credentials, or network exfiltration; it only references a local file path and an optional CHROME_PATH override.
Install Mechanism
There is no install spec (instruction-only), so nothing is downloaded or written by the skill itself — this is the lowest-risk install model and matches the content.
Credentials
The skill requests no credentials and no config paths. SKILL.md mentions an optional CHROME_PATH environment variable (not declared in the metadata) and suggests installing fonts on Linux; both are reasonable but the CHROME_PATH mention is a slight metadata omission.
Persistence & Privilege
always is false and the skill does not request permanent presence or modify other skills/config. The default ability for the agent to invoke the skill autonomously is unchanged and is not concerning here given the skill's narrow scope.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install lh-html-to-image - 安装完成后,直接呼叫该 Skill 的名称或使用
/lh-html-to-image触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
Remove coupled messaging, pure image generation
v1.0.0
Initial release: Generate images from HTML+CSS via Chrome headless
元数据
常见问题
LH HTML to Image 是什么?
Convert HTML+CSS into PNG images via Chrome headless for accurate text layouts like covers, posters, and info cards at zero API cost. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 663 次。
如何安装 LH HTML to Image?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install lh-html-to-image」即可一键安装,无需额外配置。
LH HTML to Image 是免费的吗?
是的,LH HTML to Image 完全免费(开源免费),可自由下载、安装和使用。
LH HTML to Image 支持哪些平台?
LH HTML to Image 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 LH HTML to Image?
由 liuhedev(@liuhedev)开发并维护,当前版本 v1.0.1。
推荐 Skills