PImage img = loadImage("robotmarko.jpg"); size(600, 400); loadPixels(); img.loadPixels(); for (int y = 0; y < img.height; y++) for (int x = 0; x < img.width; x++) { int imgIndex = x + y * img.width; float r = red(img.pixels[imgIndex]); pixels[imgIndex] = color(r, 0, 0); } updatePixels();