HTML to Image
Controlled node
Overview
The HTML to Image node renders HTML content into an image using a headless browser. This is useful for generating screenshots of HTML content, creating visual reports, or capturing web-based content as static images.
By default, the node captures the full page height of the rendered HTML. You can disable this to capture only the viewport area defined by the width and height inputs.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Fires when the node starts running | - |
| HTML | Text | The HTML content to render as an image | - |
| Width | Number | The viewport width in pixels | 1920 |
| Height | Number | The viewport height in pixels | 1080 |
| Full Page | Boolean | If true, captures the full page height. If false, captures only the specified viewport height | true |
Outputs
| Output | Type | Description |
|---|---|---|
| Output | Image | The rendered image as a Jimp image object |
| Done | Event | Fires when the node has finished rendering |
Runtime Behavior and Defaults
When triggered by the Run event, the node processes the HTML input through a headless browser rendering service. The rendering respects the specified width and height dimensions.
- Full Page Mode: When
Full Pageis set totrue(default), the node captures the entire scrollable height of the rendered HTML, not just the viewport. - Viewport Mode: When
Full Pageis set tofalse, the output is cropped to the exact dimensions specified byWidthandHeight. - Default Dimensions: The default viewport size is 1920×1080 pixels, suitable for standard desktop screenshots.
The output is a Jimp image object that can be processed by other image nodes (such as Resize Image, Crop Image, or Write To Library) or used directly in your workflow.
Example Usage
Basic HTML to Image Conversion:
- Create a Text node containing your HTML content (e.g.,
<html><body><h1>Hello World</h1></body></html>) - Connect the Text node's output to the HTML input of the HTML to Image node
- Connect a Start node or other trigger to the Run input
- Connect the Output to a Write To Library node to save the image, or to an AI Vision Write node to analyze the rendered content
Custom Screenshot Dimensions:
- Set Width to
1200and Height to800for a mobile-sized screenshot - Set Full Page to
falseto capture only the visible viewport area - Set Full Page to
trueto capture the entire scrollable content of the HTML document