Skip to content

Instantly share code, notes, and snippets.

@danasf
Created June 23, 2014 22:10
Show Gist options
  • Select an option

  • Save danasf/2e6884f590f1a9eb9236 to your computer and use it in GitHub Desktop.

Select an option

Save danasf/2e6884f590f1a9eb9236 to your computer and use it in GitHub Desktop.
GIFfy
/**
* GIFfy
* Make an animated gif from your quicktime .mov screen capture
* Public Domain
*/
import processing.video.*;
import gifAnimation.*;
Movie mov;
GifMaker gif;
float time=0;
// set your frame rt
float rt= (1/6.0);
void setup() {
size(600,400);
background(0);
frameRate(6);
gif = new GifMaker(this,"sine.gif");
mov = new Movie(this,"sine.mov");
mov.loop();
gif.setRepeat(0);
println("press any key to save");
}
void draw() {
if(time > 3) { time=0; } else { time = time+rt; mov.jump(time); }
image(mov,0,0,width,height);
gif.setDelay(1);
gif.addFrame();
}
void movieEvent(Movie m) {
m.read();
}
void keyPressed() {
gif.finish();
println("gif saved!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment