-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Any possible way to compress PNG or use indexed RGB on node-canvas? #332
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
Comments
See #306 |
@kkoopa Could you clarify how #306 enables saving an indexed PNG8 file? It doesn’t seem like any of the filters map to that directly. The only PNG8 example I see is using node-mapnik. |
It does not enable indexed PNG8, just setting zlib compression level and filters. |
Thanks for clarifying, @kkoopa! I guess this issue could be reopened and repurposed/renamed as “Make it possible to use PNG8 palette”, then. |
@mathiasbynens FWIW, I've been starting to use this library with indexed PNG encoding by using one of the RGBA channels (e.g. A) as our palette indices, calling I was toying with what an API in node-canvas could look like, e.g. var c = new Canvas(w, h, "palette8" /* or "alpha8" or "png8" or ... */);
c.pngStream({palette: /* a Uint8ClampedArray of RGBA values */}); which seems all and well until you get to |
Actually, I just discovered PR #678, which lets you set any of Cairo's native formats (including alpha8). @mathiasbynens that would be a good place to discuss this further. |
Reopening this until we can get it resolved :) |
I'm not sure is it possible or not? by node-canvas api after we use "createPNGStream" image will be in indexed rgb format or PNG-8
Thank you!
The text was updated successfully, but these errors were encountered: