createQuadrille(width, image)

Converts an image (a p5.Image, p5.Graphics) or video p5.MediaElement into a quadrille with the specified number of columns (width), pixelating the image into cells.

Example

code
let ps;
let quadrille;

function preload() {
  ps = loadImage('/images/pola.jpg');
}

function setup() {
  Quadrille.cellLength = 25;
  createCanvas(24 * Quadrille.cellLength, 24 * Quadrille.cellLength);
  quadrille = createQuadrille(24, ps);
}

function draw() {
  background('orange');
  drawQuadrille(quadrille);
}
ℹ️
createQuadrille(width, image) converts an image into a quadrille, with each cell representing a sub-image.

Syntax

createQuadrille(width, image)

Parameters

ParamDescription
widthNumber: The total number of columns for the quadrille
imagep5.Image, p5.Graphics or video p5.MediaElement: The image to be pixelated into the quadrille