pixelGrid
The pixel grid of a dither: the layer inside it chopped into square cells of a given size.
pixelGrid(slots: {size: PropRef}): PixelGrid
Import patterns from shaders/std and use patterns.pixelGrid.
size is a prop in pixels of the authored frame, so the cell count stays the same when the canvas renders at a higher resolution. Build it once and pass the same grid to quantise and ditherInks.
Parameters
| Name | Type | Notes |
|---|---|---|
slots | {size: PropRef} |
Example
const grid = pixelGrid({size: p('pixelSize')})
See also
quantise— Reduces each grid cell of the layer inside to 0 or 1 using a dither pattern.ditherInks— A dither filter: colors the 0/1 levels fromquantise, either with two colors of your own or with darkened and brightened versions of the layer's own pixels.