Image noise: Difference between revisions
Content added Content deleted
m (→Optimized example: Fixed typo (hight → height)) |
(Add Processing) |
||
Line 2,416: | Line 2,416: | ||
end Image_Noise;</lang> |
end Image_Noise;</lang> |
||
=={{header|Processing}}== |
|||
<lang processing>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); |
|||
}</lang> |
|||
=={{header|PureBasic}}== |
=={{header|PureBasic}}== |