Full-featured JavaScript GIF encoder that runs in your browser.

Usage

var gif = new GIF({ workers: 2 , quality: 10 }); gif.addFrame(imageElement); gif.addFrame(canvasElement, {delay: 200 }); gif.addFrame(ctx, {copy: true }); gif.on( 'finished' , function ( blob ) { window .open(URL.createObjectURL(blob)); }); gif.render();

Demo

GIF images are generated in the background using web workers. Hover the original and reference tabs to see respective image.

Reference images are rendered with photoshop cs6 using the perceptual setting with no dither.

Original

Reference Quality 10 Delay 500ms Repeat forever Dither None Atkinson Atkinson-serpentine FalseFloydSteinberg FalseFloydSteinberg-serpentine FloydSteinberg FloydSteinberg-serpentine Stucki Stucki-serpentine Loading...

Original

Reference Quality 10 Dither None Atkinson Atkinson-serpentine FalseFloydSteinberg FalseFloydSteinberg-serpentine FloydSteinberg FloydSteinberg-serpentine Stucki Stucki-serpentine Loading...

Original

Reference Quality 10 Dither None Atkinson Atkinson-serpentine FalseFloydSteinberg FalseFloydSteinberg-serpentine FloydSteinberg FloydSteinberg-serpentine Stucki Stucki-serpentine Loading...

Other tests