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 outuput the pixels value as an RGB array instead of Buffer. #72

Open
fromb2b opened this issue Jun 8, 2022 · 0 comments
Open

Comments

@fromb2b
Copy link

fromb2b commented Jun 8, 2022

Hi,

I tried the decoding function in Node JS. When I loged, I got a Buffer instead of the expected array of pixels RGB values. How can I get an RGB array instead please.

var PNG = require("png-js"); PNG.decode("UVB-TEST.png", function (pixels) { // pixels is a 1d array (in rgba order) of decoded pixel data console.log(pixels); });

I would also know if there is a possibility to decode a function by providing its url instead of saving it in a local folder (because I need to process hundreds of images).

Thank you for your assistance.

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

1 participant