xxxxxxxxxx
48
// TODO: upload as an example of dithering
let printLayer1;
let printLayer2;
let img;
//let ditherType = 'atkinson';
let s = 200;
let ditheredImg;
function preload() {
img = loadImage('data/t1024.png');
}
function setup() {
pixelDensity(1);
createCanvas(640, 480);
printLayer1 = new Riso('HUNTERGREEN', 640, 480);
printLayer2 = new Riso('FLATGOLD', 640, 480);
capture = createCapture(VIDEO);
capture.hide();
ditheredImg = ditherImage(img, 'floydsteinberg', 32); //dither img object
}
function draw() {
background('white');
clearRiso();
// let ditherType = 'bayer'; //variable for our dither type
let ditherType = 'atkinson';
// let ditherType = 'floydsteinberg';
//let ditherType = 'none';
let ditheredVideo = ditherImage(capture, ditherType, 64); //dither img object
printLayer1.image(ditheredVideo, 0,0);
printLayer2.image(ditheredImg, 0,0, 640, 640);
drawRiso();
}
function mouseClicked() {
exportRiso();
}