HTML to Image for Openclaw

A high-performance skill for converting HTML and CSS layouts into professional-grade images using Chrome headless technology.

liuhedev
v1.0.1
Mar 4, 2026
0
1.3k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install lh-html-to-image

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install lh-html-to-image using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is HTML to Image?

The HTML to Image skill is a powerful utility within the ecosystem of Openclaw Skills that allows developers to render HTML and CSS as high-quality images. Unlike generative AI tools that might struggle with text rendering, this skill uses the Chrome headless engine to ensure that typography and layouts are pixel-perfect and exactly as defined in the source code. It is an ideal solution for developers who need to automate the creation of visual assets without incurring API costs.

By leveraging standard web technologies, this skill provides 100% accurate text rendering and total control over the final output. It is specifically designed for text-heavy visual content where precision is paramount, making it a staple for creators who use Openclaw Skills to streamline their content production pipelines.

HTML to Image Use Cases

  • Automated generation of cover images featuring titles, subtitles, and tags.
  • Creation of info cards for data display and complex comparison charts.
  • Production of text layout images such as quote cards and highlight graphics.
  • Batch processing of social media banners and marketing assets.

How HTML to Image Works

  1. The user creates an HTML file containing the desired content and inline CSS for styling.
  2. The skill identifies the target dimensions (e.g., 1080x1440 for portrait) and font requirements.
  3. A headless instance of Google Chrome is triggered to render the HTML file in the background.
  4. The skill captures a high-resolution screenshot of the rendered page, optionally applying a device scale factor for high-DPI output.
  5. The final image is saved locally as a PNG file, ready for distribution or further use.

HTML to Image Setup

To use this within the Openclaw Skills framework, ensure Google Chrome is installed on your system. You can configure the path to the executable if necessary.

# For macOS users
export CHROME_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"

# For Linux users (installing Noto CJK fonts for better rendering)
sudo apt install fonts-noto-cjk

The skill will automatically detect the browser path or use the CHROME_PATH environment variable to execute the screenshot commands.

HTML to Image Data Schema & Taxonomy

The skill utilizes standard HTML inputs and produces high-fidelity image outputs. The following table describes the typical configuration for generating images:

Parameter Description Recommended Value
Window Size Defines the pixel dimensions of the output image. 1080x1440 (3:4)
Scale Factor Controls the pixel density (Retina/High-DPI). 2 for high quality
Font Family Specifies the typography for rendering. -apple-system, Noto Sans SC
Output Format The file type of the generated asset. PNG

HTML to Image Advanced Features

  • Support for high-DPI (Retina) output using the force-device-scale-factor flag.
  • Headless mode execution to minimize resource usage and allow for server-side automation.
  • Custom environment variable support via CHROME_PATH for flexible deployment across different OS environments.
  • Zero-cost image generation with no external API dependencies or subscription fees.
  • Full support for CJK fonts and complex CSS layouts including Flexbox and Grid.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*