D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
crocuta
Full window
Github gist
random dithering
Built with
blockbuilder.org
<!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.13/p5.js"></script> <style> body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } svg { width:100%; height: 100% } </style> </head> <body> <script> function setup() { createCanvas(512, 512); } function draw() { var pink = color(255, 102, 204); loadPixels(); var d = pixelDensity; var halfImage = 4 * (width * d) * (height * d); for (var i = 0; i < halfImage; i+=4) { pixels[i] = red(pink)*random(0,1); pixels[i+1] = green(pink)*random(0,1); pixels[i+2] = blue(pink)*random(0,1); pixels[i+3] = alpha(pink)*random(0,1); } updatePixels(); filter(THRESHOLD); } </script> </body>
https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.13/p5.js