exportPng
function exportPng(params): Promise<PngOutput>;Defined in: src/png.ts:46
Render an ASL definition directly to a PNG image.
Generates an SVG from the definition, then rasterizes it to PNG using the
native resvg engine. Runs on Node only.
theme: 'auto' renders as 'light': a raster has no colour scheme to follow.
Parameters
Section titled “Parameters”params
Section titled “params”ASL definition plus diagram, background, PNG engine, and font options.
Returns
Section titled “Returns”Promise<PngOutput>
The PNG buffer along with its dimensions and format metadata.
Example
Section titled “Example”const { buffer, width, height } = await exportPng({ aslDefinition: asl, backgroundColor: '#ffffff', scale: 2,});