diff --git a/BasicImages/BasicImages.pde b/BasicImages/BasicImages.pde index 8b13789..8ecf503 100644 --- a/BasicImages/BasicImages.pde +++ b/BasicImages/BasicImages.pde @@ -1 +1,24 @@ +PImage vac; +float scalefactor = .2; +PVector loc = new PVector (width/2,height/2), vel = PVector.random2D (); +void setup () { + size(800, 600); + vac=loadImage("vacation spot.jpg"); +} + +void draw() { + background(0); + image(vac, loc.x, loc.y,vac.width*scalefactor,vac.height*scalefactor); + loc.add(vel); + if (loc.x>width) { + loc.x=0; + } else if (loc.x<0){ + loc.x = width; + } + if(loc.y>height){ + loc.y=0; + } else if (loc.y<0){ + loc.y= height; + } +} \ No newline at end of file diff --git a/BasicImages/data/vacation spot.jpg b/BasicImages/data/vacation spot.jpg new file mode 100644 index 0000000..b06e3db Binary files /dev/null and b/BasicImages/data/vacation spot.jpg differ diff --git a/FilteringImages/FilteringImages.pde b/FilteringImages/FilteringImages.pde index 8b13789..61843fa 100644 --- a/FilteringImages/FilteringImages.pde +++ b/FilteringImages/FilteringImages.pde @@ -1 +1,10 @@ - +PImage vacation; +void setup (){ + size(800,600); + vacation = loadImage("vacation spot.jpg"); +} +void draw (){ + background (0); + image(vacation,0,0,width,height); + filter(GRAY); +} \ No newline at end of file diff --git a/FilteringImages/data/vacation spot.jpg b/FilteringImages/data/vacation spot.jpg new file mode 100644 index 0000000..b06e3db Binary files /dev/null and b/FilteringImages/data/vacation spot.jpg differ diff --git a/IndependentImagePractice/IndependentImagePractice.pde b/IndependentImagePractice/IndependentImagePractice.pde index 8b13789..5cb4b0a 100644 --- a/IndependentImagePractice/IndependentImagePractice.pde +++ b/IndependentImagePractice/IndependentImagePractice.pde @@ -1 +1,35 @@ +PImage beach; +PImage beachball; +PImage sunset; //declare variables +PVector loc = new PVector (0, height/4*3); +PVector vel = new PVector (10, 20); + +void setup() { + size(800, 600); //size of canvas + beach=loadImage("beach.jpg"); + sunset=loadImage("sunset.jpg"); + + beachball=loadImage("ball.png"); //load images +} + +void draw() { + image(sunset, 0, 0, 800, 600); + + image(beach, 0, 0, 800, 600); //added images + beach.blend(sunset, 0, 0, sunset.width, sunset.height, 0, 0, beach.width, beach.height, SOFT_LIGHT); + //blended sunset with beach + image(beachball, loc.x, loc.y, 100, 100); //beach ball location + loc.add(vel); //add velocity + + if (loc.x>width) { + vel.x=-abs(vel.x); + } else if (loc.x<0) { + vel.x=abs(vel.x); + } + if (loc.y>height) { + vel.y=-abs(vel.y); + } else if (loc.y<0) { + vel.y=abs(vel.y); //bouncing of beach ball + } +} \ No newline at end of file diff --git a/IndependentImagePractice/data/ball.png b/IndependentImagePractice/data/ball.png new file mode 100644 index 0000000..02f6b90 Binary files /dev/null and b/IndependentImagePractice/data/ball.png differ diff --git a/IndependentImagePractice/data/beach.jpg b/IndependentImagePractice/data/beach.jpg new file mode 100644 index 0000000..0dafb79 Binary files /dev/null and b/IndependentImagePractice/data/beach.jpg differ diff --git a/IndependentImagePractice/data/sunset.jpg b/IndependentImagePractice/data/sunset.jpg new file mode 100644 index 0000000..fbb43fc Binary files /dev/null and b/IndependentImagePractice/data/sunset.jpg differ diff --git a/MaskingImages/MaskingImages.pde b/MaskingImages/MaskingImages.pde index 8b13789..9a13fc0 100644 --- a/MaskingImages/MaskingImages.pde +++ b/MaskingImages/MaskingImages.pde @@ -1 +1,13 @@ +PImage beach; PImage vacation; +void setup(){ + size (800,600); + vacation=loadImage("vacation spot.jpg"); + beach=loadImage("beach gray.jpg"); + vacation.mask(beach); +} + +void draw (){ + background(map(mouseY,0,height,0,255)); + image(vacation,0,0); +} \ No newline at end of file diff --git a/MaskingImages/data/beach gray.jpg b/MaskingImages/data/beach gray.jpg new file mode 100644 index 0000000..a8dc688 Binary files /dev/null and b/MaskingImages/data/beach gray.jpg differ diff --git a/MaskingImages/data/vacation spot.jpg b/MaskingImages/data/vacation spot.jpg new file mode 100644 index 0000000..ed16a21 Binary files /dev/null and b/MaskingImages/data/vacation spot.jpg differ