PImage Simg; //Source image void setup(){ Simg = loadImage("./img/color.jpg"); surface.setResizable(true); //image size window surface.setSize(Simg.width, Simg.height); noLoop(); } void draw(){ background(128); //Set bacground color PImage Dimg = createImage( Simg.width, Simg.height, RGB ); Simg.loadPixels(); for ( int y = 0; y < Simg.height; y++) { for ( int x = 0; x < Simg.width; x++) { int pos = x + y*Simg.width; color c = Simg.pixels[pos]; float r = red( c ); Dimg.pixels[pos] = color(r, 0, 0); } } Dimg.updatePixels(); image( Dimg, 0, 0); //Display }