User Tools

Site Tools


cs276:a19:hw_2

Homework 2

Category Gif JPEG PNG TIFF
Lossy/Lossless lossless lossy lossless lossless
# of Colors 256 16 Million 16 Million 16 Million
Transparency single none 8 bit paletted none
bit-depth 8 24 bit color up to 24 24
extension .gif .jpg .png .tiff
Collage

Second Collage

| HW2
 PImage kim, kim1, kim2, kim3, kim4;
 
 
void setup() {
  size(640, 480);
  kim = loadImage("kimmy.png");
  noLoop();
 
 
}
 
  void draw() {
    image(kim, 0, 0);
    int a=0;
    int b =0;
    int t =10;
    int r = 255;
    kim1 = kim.get();
    kim1.resize(0, 48);
    kim2 = kim.get();
    kim2.resize(0, 48);
    kim3 = kim.get();
    kim3.resize(0, 80);
    kim4 = kim.get();
    kim4.resize(0, 80);
 
 
    for(int i =0; i< 20; i++) {
      tint(t, 50, 50, r);
      image(kim1, a, b);
      a = a +20;
      b= b+10;
      t = t +20;
      r=r-10;
    }
    t =0;
    r = 255;
 
   int c=0;
    int d=432;
    for(int i =0; i< 20; i++) {
      tint(10, 50, t, r);
      image(kim1, c, d);
      c = c +20;
      d= d-10;
      t = t +20;
      r=r-10;
    }
    t=0;
    r = 255;
    translate(500, 100);
    for(int i =0; i< 10; i++) {
      rotate(PI/5);
      tint(90, 50, t, r);
      image(kim3, 0, 0);
      t = t +20;
      r=r-10;
 
 
    }
 
     t=0;
    r = 255;
    translate(-50, -50);
 
 
      tint(50, 255, 50, r);
      image(kim4, 0, 0);
 
 
 
   saveFrame("kim2.jpg");
 
  } 
cs276/a19/hw_2.txt · Last modified: 2019/03/08 11:32 by szentam0