lecture 4 Flashcards
(8 cards)
what code would you use to load an image?
img = loadImage(“placeholder.png”);
would you load the image in draw or setup?
setup
how would you draw the image?(written in code)
image(img, 0, 0);
write the code to scale the image by twice its size, and make it track your mouse position
image(img, 0, 0);
image(img, mouseX, mouseY, img.width * 2, img.height * 2);
what function would you use to load the image before setup?
preload ( )
what image filters are available to you in openprocessing? name 3
Threshold, invert, grey, dilate, erode, posterize, blur
how many pieces of information is a pixel described?
4 (RGBA)
function setup(){
createCanvas(320,240);
pixelDensity(1);
}
what will the last line of code do?
This will make sure your canvas will only display one pixel per pixel.