Created
June 23, 2014 22:10
-
-
Save danasf/2e6884f590f1a9eb9236 to your computer and use it in GitHub Desktop.
GIFfy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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