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 at https://github.com/joyent/node/wiki/modules#wiki-graphics, but they are either simple wrappers around command line tools providing cropping and resizing or complex drawing tools like node-canvas.
This one does both PNG decoding and encoding without native dependancies:
pngjs – PNG encoder/decoder for Node.js with no native dependencies.
An example for inverting the colors of a PNG: