元画像
2フレームめ
26フレームめ
PImage myImage;
String sourceImageName = "03.JPG";
String glitchedImageName = "glitchTest6.jpg";
void settings() {
myImage = loadImage(sourceImageName);
size(myImage.width, myImage.height, P2D);
}
void setup() {
background(0);
}
void draw() {
byte[] data = loadBytes(sourceImageName);
for(int i = 0; i < frameCount*10; i++) {
int loc = (int)random(0, data.length);
data[loc] = (byte)120;
}
saveBytes(glitchedImageName, data);
myImage = loadImage(glitchedImageName);
image(myImage, 0, 0, width,height);
saveFrame("frame/gritch-######.png");
}