Function: imageSize()
ts
function imageSize(
pixels,
box,
options?
): SizeField;Tile size from a picture's brightness: dark areas get dark (default 0.25), light ones light (default 1), so detail gathers where the picture has it. pixels is RGBA data, as from loadImagePixels; the picture covers box (normally the layout's bounds), cropped like object-fit: cover. Use invert for small tiles in the light.
Parameters
| Parameter | Type |
|---|---|
pixels | { data: ArrayLike<number>; height: number; width: number; } |
pixels.data | ArrayLike<number> |
pixels.height | number |
pixels.width | number |
box | Rect |
options | { dark?: number; invert?: boolean; light?: number; } |
options.dark? | number |
options.invert? | boolean |
options.light? | number |