Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Stochastic Image Rotater
- Created: November, 15, 2017
- Author: Verity Griscti
- Version: 1.0
- This script randomly iterates through #-number of sequentially labeled images.
- (default format "image<number>.png")
- Images must be saved in the same file as the pde.
- The output is saved as a .gif Animation so it can be shared easily over the web.
- (press mouse button to end gif loop)
- The gifAnimation library is required for this to work.
- */
- import gifAnimation.*;
- GifMaker gifExport;
- void setup(){
- size(400,400);
- frameRate(20);
- gifExport = new GifMaker(this, "export.gif");
- gifExport.setRepeat(0); //= loop forever
- }
- void draw(){
- String imgName = "image" + int(random(1,4)) + ".png"; // reset to follow image title format
- PImage img;
- img = loadImage(imgName);
- image(img,0,0,width,height);
- gifExport.setDelay(5);
- gifExport.addFrame();
- }
- void mousePressed(){
- gifExport.finish();
- }
Add Comment
Please, Sign In to add comment