RosettaCodeData/Task/Image-noise/Processing/image-noise.processing

24 lines
376 B
Plaintext

color black = color(0);
color white = color(255);
void setup(){
size(320,240);
// frameRate(300); // 60 by default
}
void draw(){
loadPixels();
for(int i=0; i<pixels.length; i++){
if(random(1)<0.5){
pixels[i] = black;
}else{
pixels[i] = white;
}
}
updatePixels();
fill(0,128);
rect(0,0,60,20);
fill(255);
text(frameRate, 5,15);
}