-
Notifications
You must be signed in to change notification settings - Fork 49
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
Document encoder quality setting more explicitly (WAS: quality 10 damages color) #6
Comments
@tomlarkworthy, I also thought 1 meant worse quality but taking a look at the code you'll see otherwise: https://github.com/eugeneware/gifencoder/blob/master/lib/GIFEncoder.js#L226 |
Just ran into this issue myself, what a strange choice to make 1 the "highest"! |
Value range for setQuality is actually 1 - 30. This is directly defined by the color quantization algorithms. setQuality() code comment says:
NeueQuant constructor code comment says:
TODO: Document at README level |
@heikkipora is it possible to hand the encoder multiple base64 image and transform to gif ? (without canvas, only base64 array) |
@userbq201: Unfortunately, no. Quote from the README.md: "The chunks that get emitted by your read stream must either by a 1-dimensional bitmap of RGBA data (either an array or Buffer), or a canvas 2D context." |
@heikkipora jpg in array will suit ? |
@userbq201 your JPGs needs to be decoded to raw pixels (32bit rgba) before passing to the encoder |
It would be nice if this info was in the readme |
I also vote for documenting this. Other derived libraries that use this one doesn't include the meaning either, so it is a chain of confusion |
I have a red square on a green background. With quality 10 the red square is draw black. With quality 1, it is fine. I assumed quality 10 was the highest, although the readme is somewhat vague on what that parameter does.
The text was updated successfully, but these errors were encountered: