Reading a PNG image in Node.js

后端 未结 3 1882
眼角桃花
眼角桃花 2021-01-30 18:14

Is there an easy way in Node.js to read a PNG file and get the pixels of the image? Something like node-image, but the other way :)

I went through the libraries listed a

3条回答
  •  长情又很酷
    2021-01-30 18:53

    I think

    var myimage = new PNG('myimage.png');
    

    should be

    var myimage = new PNG.load('myimage.png');
    

提交回复
热议问题