Skip to main content

Compatibility & Specifications

Supported input types, output formats, CSS properties, and runtime environments.

1. Format Matrix

Inputs (value)

InputDetectionDescription
HTML StringText string with tagsRegular HTML/CSS rendering
HTML String Arraystring[]Multi-page PDF generation
URLhttp:// or https://Auto-fetches and renders remote HTML
Image BufferUint8Array / BufferMagic-byte recognition for PNG, JPEG, WebP, GIF, AVIF, BMP
Data URLdata:image/*;base64,...Bypasses HTML path, routed to image optimization pipeline

Outputs (format)

FormatReturn TypeFrom HTMLFrom Image
pngUint8ArraySkia render → PNG encodeDecodes and outputs PNG
jpegUint8ArraySkia render → JPEG encode (quality)Decodes and compresses JPEG
webpUint8ArraySkia render → WebP encode (quality)Decodes and compresses WebP
avifUint8ArraySkia render → AVIF encode (quality, speed)Decodes and compresses AVIF
rawUint8ArrayUncompressed RGBA pixelsUncompressed RGBA pixels
thumbhashUint8ArrayComputes ThumbHash from renderComputes ThumbHash from image
svgstringSkia vector streamWraps in <image> SVG
pdfUint8ArraySkPDFDocument vector PDFSingle-page centered PDF

2. CSS Features

  • Box Model: Margins, paddings, borders, box-sizing, and logical properties (margin-inline, etc.).
  • Flexbox: Multi-pass resolution conforming to W3C Flexbox specs.
  • Grid Layout: Basic grid tracks, placement, and gaps.
  • Typography: HarfBuzz shaping, bidirectional text (BiDi), line-breaking for CJK, Latin, Arabic, and Emoji.
  • Effects: Box shadows, border-radii, transforms, opacity, and clip paths (circle, ellipse, polygon, path).
  • Media & Containers: @media print and container queries (@container).

3. Runtime Compatibility

  • Node.js (>=20): Full support across single, multi-threaded worker pools, and explicit modules.
  • Cloudflare Workers: Full support via wasm-html-to-image/workerd.
  • Vercel Edge Runtime: Full support via wasm-html-to-image/edge-light.
  • Browsers: Runs client-side or within Web Workers.
  • Deno & Bun: Fully compatible.