Skip to content

Function: imageFill() ​

ts
function imageFill(pixels, options?): CellFill;

Color each tile with the average color of the image under it, for a mosaic. Averages are taken in linear light (as the eye would mix the colors from a distance) and weighted by alpha. Colors are computed once per layout, on first use.

pixels is plain RGBA data, so this works anywhere; in a browser, loadImagePixels gets it from a URL.

Parameters ​

ParameterType
pixelsPixels
optionsImageFillOptions

Returns ​

CellFill

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