Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import gifAnimation.*; // https://extrapixel.github.io/gif-animation/
- GifMaker gifExport;
- int start = 25;
- int end = 42;
- int frame;
- void setup() {
- size(1419, 925, P2D);
- frameRate(15);
- frame = start;
- gifExport = new GifMaker(this, "expand.gif");
- //gifExport.setRepeat(1); // make it an "endless" animation
- //gifExport.setTransparent(255, 255, 255); // make black the transparent color. every black pixel in the animation will be transparent
- }
- void draw() {
- background(255);
- if (frame <= end ) {
- PImage img;
- String frameString = String.format("%05d", frame); //5 leading zeros, change to zeros in your animation
- img = loadImage("GifFrames/Frames"+frameString+".png");
- image(img, 0, 0);
- gifExport.setDelay(1);
- gifExport.addFrame();
- frame ++;
- } else {
- gifExport.finish();
- println("gif saved");
- exit();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement