Re:Vibrant.js: Extract prominent colors from an image
by blu_jay on Tuesday May 26, 2015 @10:33PM
(#9608995)
I tackled the same problem. In fact, I utilized the same strategy you did. It is essentially the same, but allows for the user to input a gif and receive a reconstructed gif using only its "palette."
https://github.com/salkj/palette