Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to get color palette #3

Closed
forresto opened this issue Mar 11, 2013 · 5 comments
Closed

how to get color palette #3

forresto opened this issue Mar 11, 2013 · 5 comments

Comments

@forresto
Copy link

Is it true that we have to define and pass a color palette with each frame? Is there any chance that we could use something like https://github.com/antimatter15/jsgif/blob/master/NeuQuant.js to make the palette? (That project has some bugs with colors, but I don't know if it is in the quantization or the encoding.)

@deanm
Copy link
Owner

deanm commented Mar 11, 2013

Yes, the way that the GIF format is specified it is max 8-bit (256 color) indexed color. The palette is supplied in the GIF, so you must also supply it to omggif.

There are many different color reduction / quantization algorithms that you can use for choosing a palette. This is really independent of omggif / gif encoding. I don't think there should be any problem using the above NeuQuant code w/ omggif, for example. Additionally you may also want to do dither, which is normally another independent pass.

@deanm
Copy link
Owner

deanm commented Mar 11, 2013

When I have some more time I planned on working on dithering / color quantization (for example spatial color quantization and other algorithms). This would be a separate project from omggif, but I realize it would be helpful here too...

@forresto
Copy link
Author

I had some fun figuring out some monochome dithering in JS (live, code) but the color stuff seems beyond me for now.

@deanm
Copy link
Owner

deanm commented Mar 14, 2013

If you're going to monochrome 256 colors, there is no reason to dither.

@forresto
Copy link
Author

For anybody interested, here is OMGGIF working with NeuQuant.js in a worker: https://github.com/meemoo/iframework/blob/master/libs/omggif/omggif-worker.js

Live test with webcam: http://meemoo.org/iframework/#example/cam2gif

@deanm deanm closed this as completed Aug 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants