Image Kit icon

Image Kit

HTML to Image conversion service with font support

Face → Composite HTML Image

AI-generated

Summary

Render and composite HTML content into an image, optionally overlaying it on an existing input image in binary form.

Inputs

  • html_inner (required) — HTML content to composite into the output image.
  • useImage — Boolean flag to specify whether to overlay the HTML content on an existing image.
  • imageBinaryField — Binary field name containing the source image to overlay HTML onto (required if 'useImage' is true).
  • output — Output image format, e.g., PNG, JPEG, or WebP.
  • width — Width in pixels of the output image.
  • height — Height in pixels of the output image.
  • device_scale_factor — Device pixel ratio for rendering the image, e.g., 1 for normal or 2 for retina.
  • fonts — Optional list of fonts to use for rendering the HTML content, loaded dynamically from the API.

Output shape

Returns a single item containing JSON metadata about the composed image (format, width, height) and the binary image data.

If 'useImage' is true, the node consumes binary image input from the specified binary field to overlay HTML content; otherwise, it creates an image from HTML alone. The output image format can be PNG, JPEG, or WebP. The binary data is provided under the 'data' binary property with the appropriate MIME type.

Examples

Example 1: Composite HTML onto a new image

Set 'html_inner' with desired HTML, specify image width and height, select output format and device scale factor, leave 'useImage' false to create image from HTML alone.

Example 2: Overlay HTML on an existing image

Set 'useImage' to true, specify the binary field name containing the input image, enter 'html_inner' HTML content to overlay, and configure output format, size, and fonts as needed.

Links

Discussion