Make GIFs in any OpenFL project.
import sys.io.File;
import openfl.display.BitmapData;
import extension.gif.GIFEncoder;
class MyClass
{
static public function myFunction(FirstFrame:BitmapData, SecondFrame:BitmapData):Void
{
var encoder:GIFEncoder = new GIFEncoder();
encoder.addFrame(FirstFrame);
encoder.addFrame(SecondFrame);
encoder.finish();
File.saveBytes("myGif.gif", encoder.output);
}
}
Based on AS3Gif by Thibault Imbert, which in turn was based on AnimatedGifEncoder by Kevin Weiner.
- Lempel–Ziv–Welch (LZW) encoding originally by Jef Poskanzer by way of J.M.G. Elliott.
- NeuQuant neural net quantization by Anthony Dekker (see copyright notice in
NeuQuant.hx
). - Haxe neural net code by Nickolay Grebenshikov.
Shared under an MIT license. See license.md
for details.