← Back to Skills Marketplace
liuhedev

LH HTML to Image

by liuhedev · GitHub ↗ · v1.0.1
cross-platform ✓ Security Clean
663
Downloads
0
Stars
1
Active Installs
2
Versions
Install in OpenClaw
/install lh-html-to-image
Description
Convert HTML+CSS into PNG images via Chrome headless for accurate text layouts like covers, posters, and info cards at zero API cost.
README (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=2 for retina/high-DPI output (doubles pixel dimensions)
  • Use --force-device-scale-factor=1 for 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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install lh-html-to-image
  3. After installation, invoke the skill by name or use /lh-html-to-image
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
Remove coupled messaging, pure image generation
v1.0.0
Initial release: Generate images from HTML+CSS via Chrome headless
Metadata
Slug lh-html-to-image
Version 1.0.1
License
All-time Installs 1
Active Installs 1
Total Versions 2
Frequently Asked Questions

What is 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. It is an AI Agent Skill for Claude Code / OpenClaw, with 663 downloads so far.

How do I install LH HTML to Image?

Run "/install lh-html-to-image" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is LH HTML to Image free?

Yes, LH HTML to Image is completely free (open-source). You can download, install and use it at no cost.

Which platforms does LH HTML to Image support?

LH HTML to Image is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created LH HTML to Image?

It is built and maintained by liuhedev (@liuhedev); the current version is v1.0.1.

💬 Comments