{"_id":"canvas-dither","_rev":"2-b738b38b502d6d4549974be59423501b","name":"canvas-dither","description":"Black and White dithering for the canvas element","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"canvas-dither","version":"1.0.0","description":"Black and White dithering for the canvas element","main":"src/canvas-dither.js","scripts":{"bundle":"browserify src/canvas-dither.js --standalone CanvasDither -o dist/canvas-dither.js","uglify":"uglifyjs dist/canvas-dither.js -cm --overwrite -o dist/canvas-dither.js","build":"npm run bundle && npm run uglify","lint":"eslint --fix src/canvas-dither.js","test":"npm run lint"},"repository":{"type":"git","url":"git+https://github.com/NielsLeenheer/CanvasDither.git"},"keywords":["dithering","dither","canvas","bw","black","white","1 bit"],"author":{"name":"Niels Leenheer"},"license":"MIT","bugs":{"url":"https://github.com/NielsLeenheer/CanvasDither/issues"},"homepage":"https://github.com/NielsLeenheer/CanvasDither#readme","devDependencies":{"browserify":"^14.5.0","eslint":"^4.11.0","eslint-config-google":"^0.9.1","uglify-es":"^3.1.10"},"gitHead":"9cd24d15fc2dc5f9cd599fc5ef56d3564931f86b","_id":"canvas-dither@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.4.0","_npmUser":{"name":"nielsleenheer","email":"niels@leenheer.nl"},"dist":{"integrity":"sha512-JBxBfROOrRbYtM0Hjlo1aU+bSW2AdAjA8nV0HnJJh7kf4194x0GsVCwquiMfxdoiM2ZZEqEDYI5CUVjbi3ct2w==","shasum":"dda0b991a10a06f155e1374e9ab533c490369781","tarball":"https://registry.npmjs.org/canvas-dither/-/canvas-dither-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHBPsDonyjDa8yGoBwwUnw2cBOtPVdhAtCoM2ZRExwXXAiEAqSdHFfHmd/LZeX/EogNO7NGsUEMXNLLh+pYAwj5JpM8="}]},"maintainers":[{"name":"nielsleenheer","email":"niels@leenheer.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/canvas-dither-1.0.0.tgz_1511437108426_0.6112855884712189"},"directories":{}},"1.0.1":{"name":"canvas-dither","version":"1.0.1","description":"Black and White dithering for the canvas element","main":"src/canvas-dither.js","scripts":{"bundle":"browserify src/canvas-dither.js --standalone CanvasDither -o dist/canvas-dither.js","uglify":"uglifyjs dist/canvas-dither.js -cm --overwrite -o dist/canvas-dither.js","build":"npm run bundle && npm run uglify","lint":"eslint --fix src/canvas-dither.js","test":"npm run lint"},"repository":{"type":"git","url":"git+https://github.com/NielsLeenheer/CanvasDither.git"},"keywords":["dithering","dither","canvas","bw","black","white","1 bit"],"author":{"name":"Niels Leenheer"},"license":"MIT","bugs":{"url":"https://github.com/NielsLeenheer/CanvasDither/issues"},"homepage":"https://github.com/NielsLeenheer/CanvasDither#readme","devDependencies":{"browserify":"^16.5.2","eslint":"^7.7.0","eslint-config-google":"^0.14.0","uglify-es":"^3.3.9"},"gitHead":"992dc997c4a7039f8e0a8f7245302ce4ebf4b97f","_id":"canvas-dither@1.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"nielsleenheer","email":"niels@leenheer.nl"},"dist":{"integrity":"sha512-wT1RnV2y9SauibcsfMMCagQTnXmyQq2nJXuX5tTEvo0sXm1vVbJ2r8QxSC3fRQMY3ZgZVq1j54cOvmO4u+Lu/A==","shasum":"a340fc72241e0dcb6194ab9d916174ef99d7ab88","tarball":"https://registry.npmjs.org/canvas-dither/-/canvas-dither-1.0.1.tgz","fileCount":6,"unpackedSize":10075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOthFCRA9TVsSAnZWagAAbP0P+QD3zkbxPDpaSJSa5EKe\nuJsknFqg00ICWGW83dPbteJWS8lbpz5i9xS3uwUxYIfm2h0j7nKQekmV3abl\nf4tNjA7+JJNQG0AZcP1wle1AR1PfXtO9pyILoEbQQg/+st5F6i2oA6JQNz+y\n3d8PNV/25y7nsauIwEZRJYnyjnARkNzedMqStk5Ysya2t/YncmiGyztMjcaJ\ndney44KhY/y5CIJoH3wuJIKey9IEBav/j14d5pDps9QO1D1mrbhatdfOL04J\nlQjgC8HIYVvKjBFKqw/yrMO9nG477SncsuGHvg5Y3EvbrX/xYfcYAHV69phK\nUc/u7hVB8OM4VrkYhKHcBVJ9cgdVrNzgiz7JtjEYfvJbDlKvZhqV7+Uo44ow\nbd4y/Gkb7IKzxp2JOm7LRh+7sW7bvlK1U8jqFS2k8gAo5J9dz5mNNFtRCnbo\nV/nYe+ARaFqt9JTsiA9NBIRjkuGED2sbxccOeh7z0SDXPhEVJP5/8DgX/IlY\nbuLp+C+iXrn3HvHsaPc3R6GqwhDRvnb0Ssz0Xk/a5WhYtVjxsXDc0OeEB850\nsBsUxylBJZloGimZYrBWeSE3Cco/NlvjfzrgIi+NckNTjshyb7X1Tpl4Zmsk\nov8628SHn7sXFbFLj7tRvhsrXAE6kkg+H+erIQzXsDyPpv95bwAIooTDYuQK\ni/Er\r\n=QxJ8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE0PLcx8hphoPMasn8mQQQa2Q49CWvncg3Y2kTTCCrU0AiEA6t6YV3Y5cTKbLNFtoTlczOiq0YkUNp8us/2E6/rm9wA="}]},"maintainers":[{"name":"nielsleenheer","email":"niels@leenheer.nl"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/canvas-dither_1.0.1_1597691973051_0.08158311770727811"},"_hasShrinkwrap":false}},"readme":"# canvas-dither\n\nBlack and White dithering for the canvas element\n\n## Usage\n\nFirst, install the package using npm:\n\n    npm install canvas-dither --save\n\nThen, require the package and use it like so:\n\n    let Dither = require('canvas-dither');\n\n    // Assume we have an existing canvas element with a 2D context\n    // Retrieve the image data of the canvas\n    let image = context.getImageData(0, 0, canvas.width, canvas.height);\n\n    // Dither the data using the Atkinson algoritm\n    image = Dither.atkinson(image);\n\n    // Place the image data back on the canvas\n    context.putImageData(image, 0, 0);\n\nThis package contains the following algorithms:\n\n### Threshold\nA simple threshold which will make all pixels with a luminance over the threshold white and under the threshold black. \n\n    Dither.threshold(imageData, threshold);\n\n### Bayer\nUsing a Bayer matrix the image is converted to black and white with a cross-hatch pattern. \n    \n    Dither.bayer(imageData, threshold);\n\n### Floyd-Steinberg\nAltough there is nothing random about this algorithm, the results looks like a random scattering of dots, making especially photos seem very natural.\n\n    Dither.floydsteinberg(imageData);\n\n### Bill Atikinson\nAn improved version of the Floyd-Steinberg algorithm created by Bill Atkinson of MacPaint fame. This algorithm creates less noise in almost white backgrounds compared to Floyd-Steinberg, but has more contrast as a result.\n\n    Dither.atkinson(imageData);\n\n\n## License\n\nMIT","maintainers":[{"name":"nielsleenheer","email":"niels@leenheer.nl"}],"time":{"modified":"2022-04-12T05:12:49.910Z","created":"2017-11-23T11:38:29.296Z","1.0.0":"2017-11-23T11:38:29.296Z","1.0.1":"2020-08-17T19:19:33.153Z"},"homepage":"https://github.com/NielsLeenheer/CanvasDither#readme","keywords":["dithering","dither","canvas","bw","black","white","1 bit"],"repository":{"type":"git","url":"git+https://github.com/NielsLeenheer/CanvasDither.git"},"author":{"name":"Niels Leenheer"},"bugs":{"url":"https://github.com/NielsLeenheer/CanvasDither/issues"},"license":"MIT","readmeFilename":"README.md"}