gif-export
int a = 0;
void setup() {
size(540, 540);
}
void draw() {
ellipse(width/2,height/2,a,a);
a++;
gif(40);
}
---
The gif-function can be stored in a separate file (gifexport.pde)
import gifAnimation.*;
GifMaker gifExport;
void gifsetup() {
println("gifAnimation " + Gif.version());
gifExport = new GifMaker(this, "export.gif");
gifExport.setRepeat(0);
gifExport.setDelay(50);
}
void gif(int frames) {
if (frameCount == 1){
gifsetup();
}
gifExport.addFrame();
if (frameCount == frames) {
gifExport.finish();
println("gif saved");
exit();
}
}