Skip to content

Randomized Positions

let dali = new Image();
dali.src = 'static/dali.jpg';
dali.onload = () => {
const randomized = new headbreaker.Canvas('randomized-canvas', {
width: 800, height: 650,
pieceSize: 100, proximity: 20,
borderFill: 10, strokeWidth: 2,
lineSoftness: 0.12, image: dali
});
randomized.autogenerate({
insertsGenerator: headbreaker.generators.flipflop
});
randomized.shuffle(0.7);
randomized.draw();
}