{"_id":"ppm","_rev":"398754","name":"ppm","description":"A simple streaming ascii PPM image parser/writer","dist-tags":{"latest":"0.0.0"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"time":{"modified":"2021-08-04T04:23:24.000Z","created":"2013-02-13T21:40:54.121Z","0.0.0":"2013-02-13T21:40:54.121Z"},"users":{},"author":{"name":"Mikola Lysenko"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/ppm.git"},"versions":{"0.0.0":{"name":"ppm","version":"0.0.0","description":"A simple streaming ascii PPM image parser/writer","main":"ppm.js","directories":{"test":"test"},"dependencies":{"through":"~2.2.0"},"devDependencies":{},"scripts":{"test":"node test/test.js"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/ppm.git"},"keywords":["ppm","image","file","save","read","write","stream"],"author":{"name":"Mikola Lysenko"},"license":"BSD","readmeFilename":"README.md","gitHead":"05d913e44f647d9bcdf436e9ecad896bd6e397c8","_id":"ppm@0.0.0","dist":{"shasum":"a433ae4ec911f4be574d184a8de0680ac01b8e39","size":3224,"noattachment":false,"key":"/ppm/-/ppm-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ppm/download/ppm-0.0.0.tgz"},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"publish_time":1360791654121,"_cnpm_publish_time":1360791654121,"_hasShrinkwrap":false}},"readme":"ppm\n===\nThis code implements a streaming parser/serializer for ascii [PPM formatted](http://netpbm.sourceforge.net/doc/ppm.html) images in JavaScript.  The PPM file format is very simple and human readable, so it can be useful when debugging graphics applications.  The downside though is that PPM is not a very efficient format, and so it is not really suitable for long term archival or transmission of images.  For those applications, you should use a standard network image format like PNG or JPEG, depending on your requirements.\n\nUsage/Installation\n==================\nTo install, first you do:\n\n    npm install ppm\n\nAnd here is how you can use it to write/read back an image:\n\n    var ppm = require(\"ppm\");\n\n    var image = [\n      [[255, 0, 0], [255, 0, 0], [255, 0, 0]],\n      [[0, 255, 0], [0, 255, 0], [0, 255, 0]],\n      [[0, 0, 255], [0, 0, 255], [0, 0, 255]]\n    ];\n\n    ppm.parse(ppm.serialize(image), function(err, img) {\n      console.log(err, img);\n    });\n\nThe API is streaming, and should be compatible with all the stand node.js features from fs/net/etc..\n\n`ppm.parse(stream, cb(err, result))`\n------------------------------------\nParses an ASCII ppm file from the stream.  When finished, calls result with the error/result of parsing the file.\n\n`ppm.serialize(image)`\n----------------------\nConverts an image into an ASCII ppm stream\n\n\nCredits\n=======\n(c) 2013 Mikola Lysenko. BSD\n","_attachments":{},"readmeFilename":"README.md","license":"BSD"}