Skip to content

Function: renderToPng() ​

ts
function renderToPng(layout, options?): Promise<Blob>;

Render a layout to a PNG (or JPEG / WebP with type) image, in the browser or a worker. Images must load (and, from other sites, allow cross-origin use) or their cells show their fill. Elsewhere, use drawLayout with your own canvas.

Parameters ​

ParameterType
layoutLayout
optionsRasterOptions & object

Returns ​

Promise<Blob>

Hat tiling and isohedral tilings after Craig S. Kaplan's hatviz and Tactile (BSD 3-Clause).