Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions BasicImages/BasicImages.pde
Original file line number Diff line number Diff line change
@@ -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;
}
}
Binary file added BasicImages/data/snow_scene.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions FilteringImages/FilteringImages.pde
Original file line number Diff line number Diff line change
@@ -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);



}
Binary file added FilteringImages/data/lights.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions IndependentImagePractice/IndependentImagePractice.pde
Original file line number Diff line number Diff line change
@@ -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);


}
Binary file added IndependentImagePractice/data/GitHub.exe
Binary file not shown.
Binary file added IndependentImagePractice/data/lights.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added IndependentImagePractice/data/santa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added IndependentImagePractice/data/snow_scene.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions MaskingImages/MaskingImages.pde
Original file line number Diff line number Diff line change
@@ -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);
}
Binary file added MaskingImages/data/lights.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MaskingImages/data/santa.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MaskingImages/data/santa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MaskingImages/data/snow_scene.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.