-
Notifications
You must be signed in to change notification settings - Fork 7
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
The maximum number of distinct colors? #5
Comments
Same problem, I'm getting a |
Hi there! Thank you for your comments. I am sorry I didn't notice these comments until today.
Option (2) is not allowable for a GIF because the GIF color lookup table for a single image has 256 slots, so even though there are 8 bits for each of R, G, and B (meaning 256 ** 3 possible colors available for a GIF), there can only ever be 256 distinct colors in a single GIF image, or a single frame of an animated GIF. Option (1) is possible for a GIF, but is not implemented in this library yet: currently this library only uses one lookup table for the entire animated gif, so even though you could theoretically have 256 distinct colors per frame (e.g. {R=0, G=0, B=[0, ..., 255]} for one frame of the animation, and then {R=0, G=[0, ..., 255], B=0} for the next frame) it is not possible in this library. Please let me know if there is interest in me implementing one lookup table per animation frame; I have not considered it but if lots of people want to I am happy to look into it — or of course would welcome a pull request! |
@tanyaschlusser Thanks for explanation I am also getting this error |
"The maximum number of distinct colors in a GIF is 256 but this image has 4896 colors and can't be encoded properly."
I have printed my ndarray, and all the values in the array are the integers between 0 and 255, I don't understand why it always give me this error? my array shape is [3,128,128,32]. Please help, thanks
The text was updated successfully, but these errors were encountered: