diff --git a/BasicImages/BasicImages.pde b/BasicImages/BasicImages.pde index 8b13789..143a9e3 100644 --- a/BasicImages/BasicImages.pde +++ b/BasicImages/BasicImages.pde @@ -1 +1,31 @@ +//delcare image +PImage christmas; +//create floats and pvecotrs +float scaleFactor=.2; +PVector loc, vel; +void setup() { + size(800, 600); + //initialize PImage + christmas = loadImage("snow_scene.jpg"); + //initialize loc and vel + loc = new PVector(width/2, height/2); + vel= PVector.random2D(); +} +void draw() { + background(0); + //create image using scale factor as well so it is proportionate + image(christmas, loc.x, loc.y, christmas.width*scaleFactor, christmas.height*scaleFactor); + //bounce image around + 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/snow_scene.jpg b/BasicImages/data/snow_scene.jpg new file mode 100644 index 0000000..fa6b867 Binary files /dev/null and b/BasicImages/data/snow_scene.jpg differ diff --git a/FilteringImages/FilteringImages.pde b/FilteringImages/FilteringImages.pde index 8b13789..1bb757e 100644 --- a/FilteringImages/FilteringImages.pde +++ b/FilteringImages/FilteringImages.pde @@ -1 +1,15 @@ +PImage lights; +void setup(){ + size(800,600); + lights = loadImage("lights.jpg"); + +} +void draw(){ + background(0); + image(lights, 0, 0, width, height); + filter(INVERT); + + + +} \ No newline at end of file diff --git a/FilteringImages/data/lights.jpg b/FilteringImages/data/lights.jpg new file mode 100644 index 0000000..f5e67c0 Binary files /dev/null and b/FilteringImages/data/lights.jpg differ diff --git a/IndependentImagePractice/IndependentImagePractice.pde b/IndependentImagePractice/IndependentImagePractice.pde index 8b13789..a434116 100644 --- a/IndependentImagePractice/IndependentImagePractice.pde +++ b/IndependentImagePractice/IndependentImagePractice.pde @@ -1 +1,27 @@ +//declare variables +PImage christmas; +PImage lights; +PImage santa; + +void setup() { + size(800, 450); //set size + // load images by adding files to sketch + christmas = loadImage("snow_scene.jpg"); + lights = loadImage("lights.jpg"); + santa = loadImage("santa.png"); + //mask lights with christmas + christmas.mask(lights); + +} + +void draw() { + // set background to allow mask + background(map(mouseY, 0, height, 0, 255)); + //create image christmas and santa + image(christmas, 0, 0); + //move santa across the scene with mouse + image(santa, mouseX, mouseY, 100, 50); + + +} \ No newline at end of file diff --git a/IndependentImagePractice/data/GitHub.exe b/IndependentImagePractice/data/GitHub.exe new file mode 100644 index 0000000..3a7e74b Binary files /dev/null and b/IndependentImagePractice/data/GitHub.exe differ diff --git a/IndependentImagePractice/data/lights.jpg b/IndependentImagePractice/data/lights.jpg new file mode 100644 index 0000000..db04934 Binary files /dev/null and b/IndependentImagePractice/data/lights.jpg differ diff --git a/IndependentImagePractice/data/santa.png b/IndependentImagePractice/data/santa.png new file mode 100644 index 0000000..86db50e Binary files /dev/null and b/IndependentImagePractice/data/santa.png differ diff --git a/IndependentImagePractice/data/snow_scene.jpg b/IndependentImagePractice/data/snow_scene.jpg new file mode 100644 index 0000000..181756e Binary files /dev/null and b/IndependentImagePractice/data/snow_scene.jpg differ diff --git a/MaskingImages/MaskingImages.pde b/MaskingImages/MaskingImages.pde index 8b13789..5205b35 100644 --- a/MaskingImages/MaskingImages.pde +++ b/MaskingImages/MaskingImages.pde @@ -1 +1,24 @@ +//declare variables +PImage christmas; +PImage lights; +PImage santa; + + +void setup() { + size(800, 450); //set size + // load images by adding files to sketch + christmas = loadImage("snow_scene.jpg"); + lights = loadImage("lights.jpg"); + //mask lights with christmas + christmas.mask(lights); + santa = loadImage("santa.png"); +} + +void draw() { + // set background to allow mask + background(map(mouseY, 0, height, 0, 255)); + //create image + image(christmas, 0, 0); + image(santa, 500, 100, 100, 50); +} \ No newline at end of file diff --git a/MaskingImages/data/lights.jpg b/MaskingImages/data/lights.jpg new file mode 100644 index 0000000..db04934 Binary files /dev/null and b/MaskingImages/data/lights.jpg differ diff --git a/MaskingImages/data/santa.jpg b/MaskingImages/data/santa.jpg new file mode 100644 index 0000000..5a2ac7a Binary files /dev/null and b/MaskingImages/data/santa.jpg differ diff --git a/MaskingImages/data/santa.png b/MaskingImages/data/santa.png new file mode 100644 index 0000000..86db50e Binary files /dev/null and b/MaskingImages/data/santa.png differ diff --git a/MaskingImages/data/snow_scene.jpg b/MaskingImages/data/snow_scene.jpg new file mode 100644 index 0000000..4428bbc Binary files /dev/null and b/MaskingImages/data/snow_scene.jpg differ