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
34 changes: 34 additions & 0 deletions BasicImages/BasicImages.pde
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
PImage riv;
PImage large;
int y = 0;
boolean flag = false;
void setup() {
riv = loadImage("riv.jpg");
large = loadImage("gov.jpg");
riv.resize(800, 600);
large.resize(800, 600);
size(1000, 800);
noCursor();
}


void draw() {
background(255);
if (flag) {
for (int i = 0; i<riv.width; i++) {
riv.set(i, y, large.pixels[i+y*riv.width]);
}
y++;
}
if (y >= riv.height) {
flag = false;
}
image(riv, mouseX-riv.width/2, mouseY-riv.height/2);
println(flag);
}

void mouseClicked() {
flag = !flag;
if (y >= riv.height) {
flag = false;
}
}
Binary file added BasicImages/data/gov.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 BasicImages/data/riv.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions FilteringImages/FilteringImages.pde
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
PImage jel;
//JELLYFISH IMAGE
void setup() {
jel = loadImage("Jellyfish.jpg");
size(800,600);
jel.resize(width,height);
//COLOR INVERSION
jel.filter(INVERT);
}

void draw() {
//DRAWING THE JELLYFISH
image(jel,0,0);
}
Binary file added FilteringImages/data/Jellyfish.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions IndependentImagePractice/IndependentImagePractice.pde
Original file line number Diff line number Diff line change
@@ -1 +1,57 @@
PImage img;
PImage ant;
PImage im2;
PImage han;
//number of clicks
int c = 0;
boolean flag = false;

void setup() {
img = loadImage("Hydrangeas.jpg");
ant = loadImage("anthracite.jpg");
img.resize(width,height);
ant.resize(width,height);
img.mask(ant);
im2 = loadImage("Hydrangeas.jpg");
im2.resize(width,height);
//white hand and transparent from black on white
han = loadImage("hand.png");
han.filter(INVERT);
han.mask(han);
han.resize(128,245);
size(800,600);
textSize(20);
}

void draw() {
//shows through mask. Changes blue value per click and resets every 8th
background(200,50,32*c%256);

//show masked image if mouse pressed, else the original
if (mousePressed) {
image(img,0,0);
}
else {
image(im2,0,0);
}
//artistic filter
filter(POSTERIZE,4);
//write click number
text(c,30,200);

//once clicked 16 times, special message and flag set.
if(c==16) {
text("hand retrieved",420,20);
flag = true;
noCursor();
}

//gives hand "cursor" after 16 clicks
if (flag) {
image(han,mouseX-han.width/2,mouseY-han.height/2);
}
}

void mouseClicked() {
c+=1;
}
Binary file added IndependentImagePractice/data/Hydrangeas.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/anthracite.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/hand.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions MaskingImages/MaskingImages.pde
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
PImage mask;
PImage img;
void setup() {
mask = loadImage("eye.jpg");
img = loadImage("guv.jpg");
img.resize(mask.width,mask.height);
//dimensions of image
size(500,500);
img.mask(mask);
}

void draw() {
background(255,0,0);
//image in center
image(img,width/2-img.width/2,height/2-img.height/2);
}
Binary file added MaskingImages/data/eye.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/guv.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/some old guy.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.