New images for 2.0 Image Examples

This commit is contained in:
Casey Reas
2011-09-15 03:59:03 +00:00
parent b1584bf1f6
commit 346741702f
9 changed files with 88 additions and 125 deletions
@@ -5,20 +5,24 @@
* in different parts of the image. The two images are blended
* together using the mask() method of PImage.
*/
// @pjs preload must be used to preload media if the program is
// running with Processing.js
/* @pjs preload="moonwalk.jpg,mask.jpg"; */
PImage img;
PImage maskImg;
PImage imgMask;
void setup() {
size(200, 200);
img = loadImage("test.jpg");
maskImg = loadImage("mask.jpg");
img.mask(maskImg);
size(640, 360);
img = loadImage("moonwalk.jpg");
imgMask = loadImage("mask.jpg");
img.mask(imgMask);
imageMode(CENTER);
}
void draw() {
background(map(mouseX+mouseY, 0, width+height, 0, 255));
background(0, 102, 153);
image(img, width/2, height/2);
image(img, mouseX, mouseY);
}