pixelate

Turns the child into a grid of flat cells, each showing one color.

pixelate(opts: {scale: ArgSpec; gap: ArgSpec; roundness: ArgSpec}): GatherEffect

Import effects from shaders/std and use effects.blurs.pixelate.

scale is the number of cells along the canvas's longer edge (1–200; more cells means smaller pixels). gap (0–1) is the transparent space between cells as a fraction of a cell. roundness (0–1) rounds each cell from a square to a circle.

Parameters

NameTypeNotes
opts{scale: ArgSpec; gap: ArgSpec; roundness: ArgSpec}

Example

effect: pixelate({scale: p('scale'), gap: p('gap'), roundness: p('roundness')})

See also

  • scatter — Scatters every pixel of the child by a random offset: a grainy diffusion, not a smooth blur.
  • sharpen — Sharpens the child by boosting the contrast between each pixel and its neighbours.

Used by

Pixelate