{"_id":"canvasutil","_rev":"14-142ab8a8d7f24521afd17c5c698bbd1d","name":"canvasutil","description":"Pixel transformations and processing for canvas","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.0":{"name":"canvasutil","description":"Pixel transformations and processing for canvas","version":"0.0.0","author":{"name":"Ryan Day","email":"soldair@gmail.com"},"keywords":["canvas","grayscale","transform"],"main":"./app.js","homepage":"http://github.com/soldair/node-canvasutil","dependencies":{"canvas":">= 0.4.3"},"repository":{"type":"git","url":"git://github.com/soldair/node-canvasutil.git"},"engines":{"node":">=0.2.3"},"_id":"canvasutil@0.0.0","_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.7","directories":{"lib":"./lib"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"29ea47ddf0b6770193f5b4bd622f070d8357e87b","tarball":"https://registry.npmjs.org/canvasutil/-/canvasutil-0.0.0.tgz","integrity":"sha512-al+op1bhUdjRWA0avQnltZH0lrp6l7T3ZnTZBI0vmsGPgP4pW+jqfc5PMePJaPtnvvvTldZ//7h/BWTZiys5tA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB7VYTI01JIHGjeVAu7Ix0WHTMYnOJb7r2DRb8mugOtJAiEAowa5ibTzxkcF10GKamq0XMQjWGpIBNwBwl3E5nCidfU="}]}},"0.0.1":{"name":"canvasutil","description":"Pixel transformations and processing for canvas","version":"0.0.1","author":{"name":"Ryan Day","email":"soldair@gmail.com"},"keywords":["canvas","grayscale","transform"],"main":"./app.js","homepage":"http://github.com/soldair/node-canvasutil","dependencies":{"canvas":">= 0.4.3"},"repository":{"type":"git","url":"git://github.com/soldair/node-canvasutil.git"},"engines":{"node":">=0.2.3"},"_id":"canvasutil@0.0.1","_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.7","directories":{"lib":"./lib"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"c9c389ddbb3b5e7e3b2a39d1fb3f179216ecf46b","tarball":"https://registry.npmjs.org/canvasutil/-/canvasutil-0.0.1.tgz","integrity":"sha512-VxKZPZpjecsmp5lBYTmbicoqkdQAN7xc4DGLsTc1z5Y2X+SubNqHTHCiYGlF7bsMA7G8RqAISPwrW/hLQgOPAQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIecl+egSn5vwISe8xibjdGa23c1pUXBY3Pw/WJtzTOgIgALDx7Sfsj57vvWvLd+mQ17idz6tY6oyuH64g6TEzD60="}]}},"0.0.2":{"name":"canvasutil","description":"Pixel transformations and processing for canvas","version":"0.0.2","author":{"name":"Ryan Day","email":"soldair@gmail.com"},"keywords":["canvas","grayscale","transform"],"main":"./app.js","homepage":"http://github.com/soldair/node-canvasutil","dependencies":{"canvas":">= 0.4.3"},"repository":{"type":"git","url":"git://github.com/soldair/node-canvasutil.git"},"engines":{"node":">=0.2.3"},"_id":"canvasutil@0.0.2","_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.7","directories":{"lib":"./lib"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"76049fcd4a1939fdc1ca61326eed748cc18ff50f","tarball":"https://registry.npmjs.org/canvasutil/-/canvasutil-0.0.2.tgz","integrity":"sha512-RqAWU+pFm715AVU41schrET7SMXW5XlSMnk0jxtNGNqH6JDoCFP/3RFYq+iYc9Nm0CtOQloP0pHWLK9QWt7h9A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICfe9wlNOcfHCS84mWrQfBb6ovMuWHcHuOOoY7/fpYf/AiAs8NkP5K69sAtvJmWX5Ncq4elzCjXuHevsM9PYLaQZBQ=="}]}},"0.0.3":{"name":"canvasutil","description":"Pixel transformations and processing for canvas","version":"0.0.3","author":{"name":"Ryan Day","email":"soldair@gmail.com"},"keywords":["canvas","grayscale","transform"],"main":"./app.js","homepage":"http://github.com/soldair/node-canvasutil","devDependencies":{"canvas":"^1.1.3"},"repository":{"type":"git","url":"git://github.com/soldair/node-canvasutil.git"},"engines":{"node":">=0.2.3"},"bugs":{"url":"https://github.com/soldair/node-canvasutil/issues"},"_id":"canvasutil@0.0.3","dist":{"shasum":"99058117bfb69356db025b4eece19e87ac0b5048","tarball":"https://registry.npmjs.org/canvasutil/-/canvasutil-0.0.3.tgz","integrity":"sha512-kgIbyA0A5V42JvwAegCd1l2VI1dNJlYTq8rLuLhnKMClQpYlqCeg39+8KPVh/FXqT3xgSrOngamx9io3ufke6w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYIl5/OeVGOG+XhuGA3aLN2Fuy5JWdNU0UHaSs/AMfMQIhAMnK0VXWnwgUczuOLo/LHlrnhoHV8D70sQqJcnTSJMg6"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"soldair","email":"soldair@gmail.com"},"maintainers":[{"name":"soldair","email":"soldair@gmail.com"}]},"0.0.4":{"name":"canvasutil","description":"Pixel transformations and processing for canvas","version":"0.0.4","author":{"name":"Ryan Day","email":"soldair@gmail.com"},"keywords":["canvas","grayscale","transform"],"homepage":"http://github.com/soldair/node-canvasutil","devDependencies":{"canvas":"^1.1.3"},"repository":{"type":"git","url":"git://github.com/soldair/node-canvasutil.git"},"engines":{"node":">=0.2.3"},"bugs":{"url":"https://github.com/soldair/node-canvasutil/issues"},"_id":"canvasutil@0.0.4","dist":{"shasum":"9033deacb931b2d8ec7d284c14f685337f7abf1e","tarball":"https://registry.npmjs.org/canvasutil/-/canvasutil-0.0.4.tgz","integrity":"sha512-aGsOwIhaVfG/fWhYF1lqos5louOjCI7Lrkt8wWR72lN0wizaIVf1YaGg4WHeIg7uhIbcW8bGrooTbU9dWTBYkA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFhrV/2kB1DXL/sGD0dkMEWXGBYsGITlq2fn6x75UyfTAiBcFCVBmQeI4kzXlqdLCEbd87ZTq4Li056oa/2JubYcFQ=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"soldair","email":"soldair@gmail.com"},"maintainers":[{"name":"soldair","email":"soldair@gmail.com"}]}},"maintainers":[{"name":"soldair","email":"soldair@gmail.com"}],"time":{"modified":"2022-06-13T05:34:32.379Z","created":"2011-04-26T09:14:50.207Z","0.0.0":"2011-04-26T09:14:50.534Z","0.0.1":"2011-05-01T10:54:29.105Z","0.0.2":"2011-05-06T02:47:23.224Z","0.0.3":"2014-05-26T04:42:33.884Z","0.0.4":"2014-05-26T05:05:17.516Z"},"author":{"name":"Ryan Day","email":"soldair@gmail.com"},"repository":{"type":"git","url":"git://github.com/soldair/node-canvasutil.git"},"readme":"node-canvasutil\n===============\n\nthis is a module designed to provide a lib of color space conversion functions and\nto provide filters for transforming pixels in a canvas image data array in wierd, fun, and useful ways.\n\napi\n-------\n\nPixelCore\npixel core is the core object used to apply transforms on a canvas.\n\nthis is a standard object so extend it as you need =)\n\n\tvar PixelCore = require('canvasutil').PixelCore\n\t, pixelProcessor = new PixelCore();\n\nthis is the only method defined in the prototype of PixelCore\nit accepts a node canvas as arg 1 and a transform callback as arg 2\n\n\tpixelProcessor.iterate(Canvas,eachPixelCallback);\n\nthis is a value that may be used in transform callbacks that have a scaling behavior\n\n\tpixelProcessor.threshold = 50;\n\nthe transforms object is a convience property to hold all available transform methods\n\n\tpixelProcessor.transforms\n\nthis holds all grayscale flavors of transforms\n\n\tpixelProcessor.transforms.grayscale\n\t//the best grayscale transform is luma so use that one unless you have a specific need\n\tpixelProcessor.transforms.grayscale.luma\n\nand i have some other interesting transforms\n\n\t//brightens everything below a threshold to threshold\n\t//threshold range is 0-100\n\tpixelProcessor.transforms.brightenThreshold\n\n\t//whitens any pixel with a saturation greater than threshold\n\t//threshold range is 0-100\n\tpixelProcessor.transforms.saturationThreshold\n\n\t//dims any pixel with a Luma greater than threshold. this is not the same as adding black\n\t//threshold range is 0-255\n\tpixelProcessor.transforms.dimThreshold\n\n\t//lighten any pixel with a Luma less than threshold. this is not the same as adding white\n\t//threshold range is 0-255\n\tpixelProcessor.transforms.lightenThreshold\n\n\nconversionLib\nconversion lib has all of the color space conversion functions.\n\nall of these function exports take 3 arguments that are the 3 components of their colorspace\nall of these function return and array with the 3 components of the new color space\n\n\trgbToHsl(r,g,b)\n\thslToRgb(h.s.l)\n\trgbToHsv(r,g,b)\n\thsvToRgb(h,s,v)\n\trgbToYuv(r,g,b)\n\tyuvToRgb(y,u,v)\n\nthis accepts r,g,b like the others bvut only returns the Y component of YUV\n\n\tluma709Only(r,g,b)\n\ni welcome pull requests for other helper methods for color conversion, opacity to color, hex to rgb etc.\ni feel that this is where they belong... for now =)\n\nexample\n-------\n\n\tvar Canvas = require('canvas')\n\t, canvas = new Canvas(100,100)\n\t,pxCore = new require('canvasutil').PixelCore;\n\t,img = new Canvas.Image();\n\n\timg.onload(function(){\n\t\tvar ctx = canvas.getContext('2d');\n\t\tctx.drawImage(img,0,0);\n\n\t\tpxCore.threshold = 30;\n\t\tpxCore.itterate(canvas,pxCore.transforms.brightenThreshold);\n\n\t\tcanvas.toDataURL(function(err,url){\n\t\t\tconsole.log(url);\n\t\t});\n\t});\n\timg.src = \"some path to an image\";\n","homepage":"http://github.com/soldair/node-canvasutil","keywords":["canvas","grayscale","transform"],"bugs":{"url":"https://github.com/soldair/node-canvasutil/issues"},"readmeFilename":"README.md","users":{"jawish":true}}