{"_id":"ditherjs","_rev":"9-17b9531618130da222327d70d0c98ceb","name":"ditherjs","description":"Image dithering library","dist-tags":{"latest":"0.10.0"},"versions":{"0.2.2":{"name":"ditherjs","description":"Javascript image dithering library","version":"0.2.2","author":{"name":"Daniele Piccone","email":"mail@danielepiccone.com"},"repository":{"type":"git","url":"https://github.com/dpiccone/ditherjs"},"keywords":["jquery-plugin","ecosystem:jquery","palette","color","dithering","pixel"],"devDependencies":{"grunt":"*","grunt-contrib-jshint":"*","grunt-contrib-uglify":"*","grunt-contrib-concat":"*"},"gitHead":"fcd654d6ae58001cec9ea7fd893a73a36fcde250","bugs":{"url":"https://github.com/dpiccone/ditherjs/issues"},"_id":"ditherjs@0.2.2","scripts":{},"_shasum":"c7196f6af443fc59c221939ec9f49f6c5d990786","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"danielepiccone","email":"mild.taste@gmail.com"},"maintainers":[{"name":"danielepiccone","email":"mild.taste@gmail.com"}],"dist":{"shasum":"c7196f6af443fc59c221939ec9f49f6c5d990786","tarball":"https://registry.npmjs.org/ditherjs/-/ditherjs-0.2.2.tgz","integrity":"sha512-XPzuqHcbfeka9zsRCcZ97SnBSY7Ybj+K4dFm4eBPpZjuwrGB3fopJcBdb5YBQvZiSrERaiWiGlScNF0U7548kw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCL/QcK/aJGGVV0hxVgBe/COoPTPsFUmxb3bTxdFqNLBwIgbyRYDQ3ZFGyRgF2qb1uOBiepx34k4zEVY/K+iwNDOWs="}]},"deprecated":"Please install v0.9.x, the code has been modularized with breaking changes to the DitherJS API","directories":{}},"0.2.3":{"name":"ditherjs","description":"Javascript image dithering library","version":"0.2.3","author":{"name":"Daniele Piccone","email":"mail@danielepiccone.com"},"repository":{"type":"git","url":"https://github.com/dpiccone/ditherjs"},"keywords":["jquery-plugin","ecosystem:jquery","palette","color","dithering","pixel"],"devDependencies":{"grunt":"*","grunt-contrib-jshint":"*","grunt-contrib-uglify":"*","grunt-contrib-concat":"*"},"gitHead":"851924e37e6ce748b89b7eb56fbd21da4675dbfa","bugs":{"url":"https://github.com/dpiccone/ditherjs/issues"},"_id":"ditherjs@0.2.3","scripts":{},"_shasum":"cd4b50543ba6138dfe4b46c25b3a5cb49856e51f","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"danielepiccone","email":"mild.taste@gmail.com"},"maintainers":[{"name":"danielepiccone","email":"mild.taste@gmail.com"}],"dist":{"shasum":"cd4b50543ba6138dfe4b46c25b3a5cb49856e51f","tarball":"https://registry.npmjs.org/ditherjs/-/ditherjs-0.2.3.tgz","integrity":"sha512-GcwRC4n/7KrCO++oBU8x5putHm7yNGabxTB9OvSVGFzSZU7MkdKrawrWUu8kwjLiSYGd+PsTFZQ5QEecQyDrow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGLaqQsQ08PIBBmzEfvgwaxjigTHBzWZb9A8wroEycm+AiBJRdmqAp42bsx+9caVhTo3aCYxKqC+tpRHHToVERQJLA=="}]},"deprecated":"Please install v0.9.x, the code has been modularized with breaking changes to the DitherJS API","directories":{}},"0.3.0":{"name":"ditherjs","description":"Javascript image dithering library","version":"0.3.0","author":{"name":"Daniele Piccone","email":"mail@danielepiccone.com"},"repository":{"type":"git","url":"git+https://github.com/dpiccone/ditherjs.git"},"keywords":["jquery-plugin","ecosystem:jquery","palette","color","dithering","pixel"],"devDependencies":{"grunt":"*","grunt-contrib-jshint":"*","grunt-contrib-uglify":"*","grunt-contrib-concat":"*"},"gitHead":"6436e9a8178ae3b15f63d4f5358bad771f552bf8","bugs":{"url":"https://github.com/dpiccone/ditherjs/issues"},"homepage":"https://github.com/dpiccone/ditherjs#readme","_id":"ditherjs@0.3.0","scripts":{},"_shasum":"11856856465a7fdea46dc2b463beef1b144c73d2","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.0.0","_npmUser":{"name":"danielepiccone","email":"mild.taste@gmail.com"},"maintainers":[{"name":"danielepiccone","email":"mild.taste@gmail.com"}],"dist":{"shasum":"11856856465a7fdea46dc2b463beef1b144c73d2","tarball":"https://registry.npmjs.org/ditherjs/-/ditherjs-0.3.0.tgz","integrity":"sha512-8iQMVt9WrLPYqO01ISamVryn4vZfqUl1mI61qxDhIxxdsyTsqpD7euCevzYuMd22xsw3alxFZWNZN6Hqm7qkXw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDfSooTjUVPxzwWPotRKhc6StvZnGCNbuqW0Z52rLrdcAiEA9RqiyTcvlDULlACQsPUEaJPVHoJ19vkcdP5VVIk5b04="}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/ditherjs-0.3.0.tgz_1462729478003_0.46778548415750265"},"deprecated":"Please install v0.9.x, the code has been modularized with breaking changes to the DitherJS API","directories":{}},"0.9.1":{"name":"ditherjs","description":"Image dithering library","version":"0.9.1","author":{"name":"Daniele Piccone","email":"mail@danielepiccone.com"},"main":"dist/ditherjs.min.js","homepage":"https://dpiccone.github.io/ditherjs/","repository":{"type":"git","url":"git+ssh://git@github.com/dpiccone/ditherjs.git"},"scripts":{"preversion":"webpack -p","test":"mocha spec/","coverage":"nyc mocha spec/","coveralls":"nyc mocha spec/ && nyc report --reporter=text-lcov | coveralls","demo:client":"webpack-dev-server --content-base demo.client","demo:server":"node demo.server/app.js","start":"node server.js"},"keywords":["graphic","graphics","palette","palettes","pattern","color","dithering","pixel"],"devDependencies":{"coveralls":"2.11.14","domino":"1.0.25","express":"4.14.0","mocha":"3.0.2","nyc":"8.3.0","unexpected":"10.16.0","webpack":"1.13.2","webpack-dev-server":"1.15.0"},"browser":{"canvas":false},"license":"CC-BY-SA-4.0","gitHead":"66dd7e35b9a18a94bdb9576b0a66324565f9c3e1","bugs":{"url":"https://github.com/dpiccone/ditherjs/issues"},"_id":"ditherjs@0.9.1","_shasum":"1a1ed0a3dd16e3893971c01d96127b7a175b3964","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.0.0","_npmUser":{"name":"danielepiccone","email":"mild.taste@gmail.com"},"maintainers":[{"name":"danielepiccone","email":"mild.taste@gmail.com"}],"dist":{"shasum":"1a1ed0a3dd16e3893971c01d96127b7a175b3964","tarball":"https://registry.npmjs.org/ditherjs/-/ditherjs-0.9.1.tgz","integrity":"sha512-UK3HSX3fANeSKfoA8emSOBTd/npFzy3y6k1FX/UiGM74IMYc7g1FHReloTiUbh9Vat0aB3Hc/zZEeBKX8bipZg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDb7YzhBZ8a+noGvY8IPAlIEA0cBOadALV+WrcX+n9COQIgEj4kbJTgR19j63Id9wE7tI0KteVowXB3l8s9IGdu0Ic="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/ditherjs-0.9.1.tgz_1474795911237_0.9163499798160046"},"directories":{}},"0.10.0":{"name":"ditherjs","description":"Image dithering library","version":"0.10.0","author":{"name":"Daniele Piccone","email":"mail@danielepiccone.com"},"main":"dist/ditherjs.dist.js","homepage":"https://dpiccone.github.io/ditherjs/","repository":{"type":"git","url":"git+ssh://git@github.com/dpiccone/ditherjs.git"},"scripts":{"preversion":"webpack -p","test":"mocha spec/","coverage":"nyc mocha spec/","coveralls":"nyc mocha spec/ && nyc report --reporter=text-lcov | coveralls","demo:client":"webpack-dev-server --content-base demo.client","demo:server":"node demo.server/app.js","start":"node server.js"},"keywords":["graphic","graphics","palette","palettes","pattern","color","dithering","pixel"],"devDependencies":{"coveralls":"2.11.14","domino":"1.0.25","express":"4.14.0","mocha":"3.0.2","nyc":"8.3.0","unexpected":"10.16.0","webpack":"1.13.2","webpack-dev-server":"1.15.0"},"browser":{"canvas":false},"license":"CC-BY-SA-4.0","gitHead":"f4d0602814ff752009c5b144924d3d23ab1c30da","bugs":{"url":"https://github.com/dpiccone/ditherjs/issues"},"_id":"ditherjs@0.10.0","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"danielepiccone","email":"mild.taste@gmail.com"},"dist":{"integrity":"sha512-mySAF/PlRcJdpttGQV0UgBG17an5TUFtWMi9BXRlCMcO1dv6A3uuso5/5n/nDJaWxgh+hwIHRdhxZzhVpbRk7Q==","shasum":"07b8fa814f87ea60dd39552ce877f74882e3730d","tarball":"https://registry.npmjs.org/ditherjs/-/ditherjs-0.10.0.tgz","fileCount":25,"unpackedSize":371047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0yVCCRA9TVsSAnZWagAAemEP/ReFez7yuuQpq0s0oAnN\nGliZKDc2hE+rBaDiYlrRq66U8NhzujxJHiRmiubyl8oCR3GthdTI5amFfQtz\n407e1rKXoKKji7DNIo0LEAbVDIzJJ3km4vEtGFpRTioEyCQAwZcsLsmE30Ld\nGTLx/SL5fn2KHTqDQs2WxnutP4APKgZFlQrxShbIIq/ZI2OV9nQ7zGIDCGmX\njjB95QPiQZDwXCqgdBPoKTtUplRpjeatjL8k4YUSzw+rRVbLkwemqrDpDomB\nkJrESrgTr1GwR70IxenXCxyTEISEFRWX76sMGyfBnkj/4q3EOx2YF/qwa3Kw\nZvYrJkKROZh9Q8t9ZwiDqnEYGn2zWxvaIKfgLhA6xt0TDQA4mqEUc56WIOj7\npCqAlV7KIssJ0X2yg7dUmFKzzJgPzcI4LUYjz5AoHam1rEUCd/2lu037JtUW\n2jOADwhY1rXcbjzgzjcJHFWJVA5IK1KkzTJ81lj1rr9V608NAaaPEEoOxpqz\nrta2qZZt5NyRzPmjVHDNH7kPEMqjSSVKKh7Q9HIOMzRq8NZElKnMoC1I1/9U\n6MZthBF73Lp9YjhB8aAy0/6DEutXhubZBJEKt33P0lcwfAoyiSVw3InUytuH\nSJ5qSuIi3ewGLvObDMSc2iRLAZ1Bf2az/TpW9CmyhdrIi6S4g7e1jXZgdazl\nhacM\r\n=C0OB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXHMYwne+aPtSie1844D6DEROPa52O8FGM4/yNNNZgzgIhAJXPwwA8Z+kOrsPVqH3rKP2ai6iThGVb4dWs7Uih0HZW"}]},"maintainers":[{"name":"danielepiccone","email":"mild.taste@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ditherjs_0.10.0_1540564290168_0.15194673139372616"},"_hasShrinkwrap":false}},"readme":"# ditherJS\n\n[![License: CC BY-SA 4.0](https://img.shields.io/badge/License-CC%20BY--SA%204.0-lightgrey.svg)](http://creativecommons.org/licenses/by-sa/4.0/)\n[![Build Status](https://travis-ci.org/dpiccone/ditherjs.svg?branch=master)](https://travis-ci.org/dpiccone/ditherjs)\n[![Coverage Status](https://coveralls.io/repos/github/dpiccone/ditherjs/badge.svg?branch=master)](https://coveralls.io/github/dpiccone/ditherjs?branch=master)\n\nA javascript library which dithers an image using a fixed palette.\n\nRun `npm run demo:client` or `npm run demo:sever` to see it in action.\n\n## Installation and dependencies\n\n```sh\n$ npm install ditherjs --save\n```\n\nBoth client and server are exposed as commonJS modules to be used with webpack or browserify.\n\nThe client-side version is also published with an UMD compatible wrapper and a jQuery plugin, those versions are in `./dist`\n\nThe server-side version needs [node-canvas](https://github.com/Automattic/node-canvas) installed as a peer dependency to work, this is also needed to run run the tests during development.\n\n```sh\n$ npm install ditherjs canvas --save\n```\n\n## Usage and options\n\nAny DitherJS instance exposes a `dither(target, [options])` method which accepts a *selector* a *Node<img>* or a *buffer* as a target and an optional options object.\n\nThe options can be passed directly to the method or directly in the constructor.\n\n```javascript\nvar options = {\n    \"step\": 1, // The step for the pixel quantization n = 1,2,3...\n    \"palette\": defaultPalette, // an array of colors as rgb arrays\n    \"algorithm\": \"ordered\" // one of [\"ordered\", \"diffusion\", \"atkinson\"]\n};\n```\n\nA default palette is provided which is CGA Palette 1\n\n![Rick dangerhous II](http://www.rickdangerous.co.uk/cga20a.png)\n\nThe palette structure is as an array of rgb colors `[[r,g,b]..]`\n\n### Client\n\n\n```javascript\nvar DitherJS = require('ditherjs');\n\nvar ditherjs = new DitherJS([,options]);\nditherjs.dither(selector,[,options]); // should target <img> elements\n```\n\nas a jQuery plugin\n```javascript\n$('.dither').ditherJS(options);\n```\n\nor directly on the element\n```html\n<img src=\"...\" onload=\"ditherjs.dither(this)\" />\n```\n\n## Server\n\n```javascript\nvar DitherJS = require('ditherjs/server');\n\nvar ditherjs = new DitherJS([,options]);\n\n// Get a buffer that can be loaded into a canvas\nvar buffer = fs.readFileSync('./myBeautifulFile.jpg|gif|png');\n\nditherjs.dither(buffer,[,options]);\n```\n\n### Testimonials\n\nUseful as a comb to a bald man. -Anon\n\nauthor 2014 [Daniele Piccone](http://www.danielepiccone.com)\n","maintainers":[{"name":"danielepiccone","email":"mild.taste@gmail.com"}],"time":{"modified":"2022-06-15T05:30:21.425Z","created":"2016-01-01T19:09:01.556Z","0.2.2":"2016-01-01T19:09:01.556Z","0.2.3":"2016-01-01T19:11:45.307Z","0.3.0":"2016-05-08T17:44:39.091Z","0.9.1":"2016-09-25T09:31:53.390Z","0.10.0":"2018-10-26T14:31:30.333Z"},"keywords":["graphic","graphics","palette","palettes","pattern","color","dithering","pixel"],"repository":{"type":"git","url":"git+ssh://git@github.com/dpiccone/ditherjs.git"},"author":{"name":"Daniele Piccone","email":"mail@danielepiccone.com"},"bugs":{"url":"https://github.com/dpiccone/ditherjs/issues"},"readmeFilename":"readme.md","homepage":"https://dpiccone.github.io/ditherjs/","license":"CC-BY-SA-4.0"}