Image Glitching

Randomly came across this lil bit of code on the processing forums. Definitely something I want to mess with.

byte[] data=loadBytes("fire.jpg");
for(int i=0;i<100;i++) // 100 changes
{
int loc=(int)random(128,data.length);
data[loc]=(byte)random(255);
}
saveBytes("editedfire.jpg",data);

Leave a Reply

Your email address will not be published. Required fields are marked *