// image // James Brink, 6/11/2020 let img0; let img1; let img2; let can5; function preload() { img0 = loadImage('GrandCanyon100.jpg'); img1 = loadImage('Elk_GrandCanyon100.jpg'); img2 = loadImage('GrandCanyon.jpg'); } function setup() { can1 = createCanvasClass(100, 180) can1.background(img0); can1.image(img1, 0, 0); can1.blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, DARKEST); can1.fill("white"); can1.text("Test backgound", 2, 115); can1.text("with image with 3", 2, 135); can1.text("arguements", 2, 155); can1.text("& blend", 2, 175); can2 = createCanvasClass(300, 300) can2.background("antiqueWhite"); can2.image(img2, 0, 0); can2.text("Tests image with 3 arguments", 5, 295); can3 = createCanvasClass(300, 300); can3.background("pink"); can3.image(img2,40, 50, 147, 110); can3.text("Tests image with 5 arguments", 5, 295); can4 = createCanvasClass(300, 300); can4.background(img2); can4.fill("antiqueWhite"); can4.rect(0, 0, 150, 113); can4.image(img2,0,0, 147, 110, 40, 30, 147, 110); can4.fill("white"); can4.text("Tests background image and image with 9 arguments", 3, 290); can5 = createCanvasClass(100, 140); can5.background("lightGoldenRodYellow"); can5.image(img0, 0, 0, 100, 100); let d = pixelDensity(); print("pixelDensity: " + d); let halfImage = 4 * (100 * d) * (100 * d / 2); can5.loadPixels(); for (let i = 0; i < halfImage; i++) { can5.pixels[i + halfImage] = can5.pixels[i]; } can5.updatePixels(); can5.text("Tests pixels", 2, 115); can5.text("& pixelDensity", 2, 135); }