jnordberg / gif.js

JavaScript GIF encoding library
http://jnordberg.github.io/gif.js/
MIT License
4.76k stars 668 forks source link

Dithering support #26

Closed panrafal closed 10 years ago

panrafal commented 10 years ago

I have merged the work of @PAEz, mentioned in https://github.com/jnordberg/gif.js/issues/12 , with some small changes (pixel format and clamping). It works pretty darn well!

You can pass dither in options with dither method's name, like Stucki. You can suffix it with -serpentine to enable serpentine scanning.

I've changed lookupRGB with findClosestRGB because I'm working on a global palette PR. But it also makes sense here...

Hope both of you like it :)

jnordberg commented 10 years ago

Thanks!