run as something like
node conv.js <image> | pta.ijs
don't forget to change the dimensions in pta.ijs.
| const PNG = require("png-js"); | |
| PNG.decode(process.argv[2], (p) => { | |
| console.log([...p].join(" ")); | |
| }); |
| key =: |.' `.-'':_",~^!=;><*\/+c?|rLvzT)s(J7[ti{}nuxlC3fI1oFY]yZ5ewajh2SkPE9Vbp6UdqKGmA4OHXRD8#B0M%N$Wg&Q@' | |
| avg =: +/ % # | |
| input =: 1!:1(3) | |
| NB. CHANGE THE FOLLOWING LINE TO THE DIMENSIONS OF YOUR IMAGE. | |
| NB. TODO: find out how to do this better. | |
| d =: 32 32 | |
| echo d$key{~<.(#key)*256%~avg@}:"1 ] _4 ]\ ". input -. CR,LF |