I'm trying to run the examples for the extractRGBChannel and extractCMYKChannel functions given on the website but it seems that the draw
function does not do anything. Is it a faulty behaviour ? Is the function the same as using the image
function (see comment in the code below)?
let img_url = "https://images.unsplash.com/photo-1579202673506-ca3ce28943ef?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=668&q=80";
let img;
function preload() {
img = loadImage(img_url);
}
function setup() {
// from the website
createCanvas(500, 500);
let blue = new Riso("blue");
let red = new Riso("red");
let justBlues = extractRGBChannel(img, "blue"); //extract blue from img
let justReds = extractRGBChannel(img, "red"); //extract red from img
// these 2 functions does not seem to display anything
blue.draw(justBlues); //draw justblues to blue layer
red.draw(justReds); //draw justred to red layer
// is the first function above similar to the one below?
//blue.image(justBlues, 0, 0);
drawRiso();
}
Many thanks for the the library. It's a lot of fun using it ๐