title: Crossfading multiple images in Processing
body: <p>Clarifying my last question:</p>
  <p>I would like to display, in Processing, many photos fading up and fading down over 15 seconds, with one second between their start times, so there are about 15 images on the screen at a time, at various levels of fading.</p>
  <p>This example displays 15 objects, but they all start together:</p>
  <pre><code>PImage[] imgs = new PImage[42];
  Pic[] pics = new Pic[15];
  
  void setup() {
    size(1000, 880);
    for (int i = 0; i &lt; pics.length; i++) {
    pics[i] = new Pic(int(random(0, 29)), random(0, 800), random(0, height));
    }
    for (int i = 0; i &lt; imgs.length; i++) {
      imgs[i] = loadImage(i+&quot;.png&quot;);
    }
  }
  
  void draw() {
    background(255);
    for (int i = 0; i &lt; pics.length; i++) {
      pics[i].display();
    }
  }
  
  class Pic {
    float x;
    float y;
    int num;
    int f = 0;
    boolean change = true;
  
    Pic(int tempNum, float tempX, float tempY) {
      num = tempNum;
      x = tempX;
      y = tempY;
    }
  
    void display() {
      imageMode(CENTER);
      if (change)f++;
      else f--;
      if (f==0||f==555)change=!change;
      tint(0, 153, 204, f);
      image(imgs[num], x, y);
    }
  }
  </code></pre>