Recitation 10: Pixel Manipulation by Haiyan Zhang

For this recitation, you will first have a quick workshop about the map() function hosted by Eszter and Jessica.

map() workshop: with Eszter and Jessica, room 824 (slides)

After participating in the map() workshop,  choose and attend one of the three workshops below covering various skills that may be useful for your final projects.  If you are in a group of more than one person, it may be a good idea to split up and attend different sessions, but this really depends on the needs of your project. 

Every workshop will have an exercise at the end, which you must document and upload as usual.  Make sure to use the map() function in your exercise.

For this exercise, I chose to do media manipulation. The image the great wave off kanagawa is from Wikipedia(https://en.wikipedia.org/wiki/The_Great_Wave_off_Kanagawa)

I mapped the value of mouseX into the levels of filter POSTERIZE to trigger real-time change. Let’s see the effect below: 

PImage img;
float level;
void setup(){
  size(1200, 807);
  img = loadImage("WAVE.jpg");
}
void draw(){
    level= map(mouseX,0,width,2,10);
  image(img,0,0,width,height);
  if (mousePressed==true){
  filter(POSTERIZE,level);
  }
}

Leave a Reply