This art project is dedicated to using images pixels as the building blocks of interactive graphics.
Source Code : Openprocessing
- Using
preload()
funtion andloadImage()
to load images before setup
function preload() {
natureImg = loadImage("sunrise.jpg");
noiseImg = loadImage("rain.jpg");
}
Reference: preload()
- Draw image on canvas
image(noiseImg, 0, 0, width, height);
Reference: image()
- Set image mode
imageMode(CENTER); //CORNER, CORNERS, or CENTER
Reference: imageMode()
- Get a region of pixels from an image
let natureImg = loadImage("nature.jpg");
let clr = natureImg.get(mouseX, mouseY);
fill(clr);
Reference: get()
- Using noise texture as filter
push();
blendMode(MULTIPY);
image(noiseImg, 0, 0, width, height);
pop();
Reference: blendMode(mode)