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

Suggestion: Make a factory method where you can put in a pre-existing array of pixel data previously obtained (like from a file) #1

Open
janerivi opened this issue Apr 16, 2017 · 2 comments

Comments

@janerivi
Copy link

something like PNG.makeFromRgbaData(width,height,arrayRGBA); and it will return a PNG instance from your pre-existing data. I was about to try to implement it myself.. but I was confused about how the buffer was set up in your code.

The usecase is for the typical PNG data with 8 bits channels for r,g,b and alpha (wich is what people use 99.99 percent of the time I would assume.

@IjzerenHein
Copy link
Owner

Hi. So this library currently only supports 8-bit indexed colors. The library is a port of an an older version of pnglib, but then modernized and faster. 32 bit colors are not yet supported though. Once that is supported, creating such a factory function would be trivial. I currently don't have any time to add it though, any PRs in this space would be welcome.
Cheers Hein

@IjzerenHein
Copy link
Owner

Hi, I just stumbled upon this. This may exactly be what you need:
https://github.com/photopea/UPNG.js

cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants