PImage myImage; PImage myIllustrationImage; String myImageFile = "base_image_distorted.png"; String myIllustrationImageFile = "base_image.png"; float y = 0; void setup() { size(410,200); background(255); frameRate(25); myImage = loadImage(myImageFile); myIllustrationImage = loadImage(myIllustrationImageFile); } void draw() { /* grab pixelline and draw line pattern */ for(int i=0;i>16 & 0xff,c>>8 & 0xff,c & 0xff, 10); line(i,0,i,height); } /* show illustration image and graphic elements */ image(myIllustrationImage, 0, 0); noStroke(); fill(255); rect(0, height/2f, width, 2); y+=0.6f; y %= (myImage.height-1); float myPosX = ((float)y / myImage.height) * (float)width; rect(myPosX, 0, 1, height/2f); }