Convert image of any format in node.js to 1d array of width * height * 4

357 Views Asked by At

User uploads an image on facebook which generates a URL similar to 'https://scontent.xx.fbcdn.net/v/t35.0-12/15491651_1204697686283902_928442274_o.jpg?_nc_ad=z-m&oh=6ac7e5b1672bb01edd785ba074a35882&oe=58521D03' I want to read this image from the URL and convert it to a form suitable for JSQR library which accepts a flat 1d array of RGBA values. How do I do this for any image format

What have I tried so far?

I tried the PNGJS library but it only works on PNG images, how can I do this for any image format? Thanks for your suggestions in advance.

0

There are 0 best solutions below