Skip to content
/ gif Public
forked from snowkit/gif

Haxe gif encoder, implementing the NeuQuant and LZW encoding algorithms

Notifications You must be signed in to change notification settings

boorik/gif

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

gif

A gif format encoder.
This only deals with the encoding (writing) and not reading of gif files (see format).

Ported from https://github.com/Chman/Moments

Haxe port by KeyMaster-
with contributions by underscorediscovery

LICENSE: The individual files are licensed accordingly.
REQUIREMENTS: Haxe 3.2, no dependencies


Simple usage

NOTE

Please note the code is currently being made more flexible and will change slightly. See snowkit#1

Specifically - instead of this code handling the file IO, it would defer the work to the using code to allow the encoding to remain adaptible to various frameworks, platforms and data transports.


Create an instance of the GifEncoder class

var encoder = new GifEncoder(repeat, quality, true);

Start encoding

//see also startOutput
encoder.startFile(filePath);

Add frames to the gif

//RGB information is in UInt8Array format,
//Which can be created with UInt8Array.fromBytes/fromArray
//for haxe.io.Bytes or Array types

var frame = {
    width: frameWidth,
    height: frameHeight,
    data: new haxe.io.UInt8Array(frameWidth * frameHeight * 3)
}

encoder.addFrame(frame);

//Configure the last added frame
//see also setFramerate
encoder.setDelay( microseconds );

End encoding

encoder.finish();

About

Haxe gif encoder, implementing the NeuQuant and LZW encoding algorithms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Haxe 100.0%