Recitation 10: OOP workshop by Linhui

Lab Date: May 3, 2019
Instructor: Marcela

In today’s recitation, I am interested in the media manipulation and it might be related to my final project.  Leon first reviewed the media manipulation knowledge and then he taught us some new skills, especially about how to combine several different media. For example, how to insert an image into the video, how to change the color of the image in the video.  At the start, I face a problem of how to control the size of the image and how to use the mouseColor, mouseR = red(mouseColor);   mouseG = green(mouseColor);   mouseB = blue(mouseColor); It is more interactive because the color will change according to the movement of the mouse. 

The size of the image can be changed by adding a variable into the position. If you use the microphone to control, you can first float I, then in.mix.get(i) to change the size of the picture.

It is also very interesting for me to use the timestapt(); function,  so that I can combine pictures and videos, for example, when the video is about a piece of music, I . can replace the background or add something when the specific moment appears to increase the audience visual and audio experience. 

PImage img1;
color mouseColor;
float mouseR, mouseG, mouseB;
void setup() {
  size(500,413);
  img1 = loadImage("1_01.jpg");
}
void draw(){
  
  image(img1,0,0,width,height);
  mouseColor = img1.get(mouseX, mouseY);
  mouseR = red(mouseColor);
  mouseG = green(mouseColor);
  mouseB = blue(mouseColor);
  println(mouseR+" "+mouseG+" "+mouseB);
  set(width/2,height/2,mouseColor);
 
  fill(mouseR,mouseG,mouseB);
  
  ellipse(width/2,height/2,200,200);
}

import processing.video.*;
PImage img1;
Movie myMovie;
void setup() {
  size(426, 240);
  myMovie = new Movie(this, "recitation10.mp4");
  myMovie.play();
  img1 = loadImage("1_01.jpg");
  myMovie.speed(1.5);
}
void draw() {
  if (myMovie.available()) {
   
    myMovie.read();
    
  }

   float timestapt = myMovie.time();
   println(timestapt);
   
 if(timestapt>10){
    tint(222,33,144);
  }
  else {
   tint(100,155,200);
  }
 image(myMovie, 0, 0);
}



Leave a Reply