{"name":"@lokesh.dhakar/quantize","version":"1.3.0","keywords":["image","quantize","color","node"],"author":{"url":"https://github.com/olivierlesnicki","name":"Olivier Lesnicki"},"license":"MIT","_id":"@lokesh.dhakar/quantize@1.3.0","maintainers":[{"name":"lokesh.dhakar","email":"lokesh.dhakar@gmail.com"}],"contributors":[{"url":"https://github.com/nrabinowitz","name":"Nick Rabinowitz"},{"url":"https://github.com/olivierlesnicki","name":"Olivier Lesnicki"}],"homepage":"https://github.com/olivierlesnicki/quantize","bugs":{"url":"https://github.com/lokesh/quantize/issues"},"dist":{"shasum":"04476889953aca94614fbc79e9a43adc7979179a","tarball":"http://registry-npm.ywwl.com/@lokesh.dhakar/quantize/download/@lokesh.dhakar/quantize-1.3.0.tgz","fileCount":8,"integrity":"sha512-4KBSyaMj65d8A+2vnzLxtHFu4OmBU4IKO0yLxZ171Itdf9jGV4w+WbG7VsKts2jUdRkFSzsZqpZOz6hTB3qGAw==","signatures":[{"sig":"MEQCIEJADBTuACu1wpkkq1uxVJb/gTIo0ra2/yJS27bUJixcAiAGn0Gr7fMI7lJVOOx9h8k35ZpOjDmpsTJU35xULEpdpQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+WYdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpdNg/+OBdAfiYKSwhlUWmgHyAkzx6wi93gwqT04S5IsNGhjw+VSNla\r\nsVf48r5ma3tuNKu/b/YNmZRmQG7EPPI1gfNRBCgeUnYw4vhkUaA3BD3HEYiZ\r\ndZDtW3zoYCcJrmpvdOt924lzHbi/R736fcssjfA/boGDCwIgbrX5h1B/BtFt\r\nwziMtVpLcqVUBGh6o7sjXj1DnA2Ycsk+l7C+MDFSH06c7bT1IKYDMRQNPw6F\r\navfNaDXMcWp/L01I7woVZTCXnwF5laROFzdF55DV0C54aGjVHZmc8h11Qd5L\r\nQloFm//vq9yr2+vkvZmoH2LTTEukU4/1XRZL05zaQo9QlS/yrG5npZUKN0xW\r\nSjCaylI6IqBAwRQr3ajpFJMZlgFuOwyWUNYE39Wb0z6yx9SEmUU5xV1CaGVH\r\nqQDFEqp+W5fYuMKJFeVKG+k4BBChiGYflvOx8okV3lzV9HtRkVdCXyE2SmHx\r\nvdBJmwIFbsFpC/qlsiys0Dnpe8gq62sjC70KM3Mlu1TNG4Ol5o+5Byja7Nrc\r\n0Ueavhri0PMaSbCYalYXj0M2j2lOjg/BxH2m4Itd+WqW0aT9WlQJ792tcadg\r\nh/Q5Amjgwr2Xix//t6kmv6NKiurat7etcOAB5lktlfwNeTnzgE7bHPKHs6Gr\r\na+GFAtlHM/Xj/MwvMObsFnNu/gKgXtuxUJQ=\r\n=lZaa\r\n-----END PGP SIGNATURE-----\r\n","size":9912,"noattachment":false,"key":"/@lokesh.dhakar/quantize/-/@lokesh.dhakar/quantize-1.3.0.tgz"},"main":"dist/index.js","module":"dist/index.mjs","source":"src/quantize.js","gitHead":"05ebca18518f8833c7de764c5b35c443834c3226","scripts":{"build":"microbundle --no-compress --no-sourcemap","watch":"microbundle --no-compress --no-sourcemap watch"},"_npmUser":{"name":"lokesh.dhakar","email":"lokesh.dhakar@gmail.com"},"repository":{"url":"git+https://github.com/lokesh/quantize.git","type":"git"},"_npmVersion":"9.3.1","description":"A node.js module for color quantization, based on Leptonica.","directories":{},"_nodeVersion":"18.14.0","_hasShrinkwrap":false,"devDependencies":{"microbundle":"^0.15.1"},"_npmOperationalInternal":{"tmp":"tmp/quantize_1.3.0_1677288988913_0.361593512314063","host":"s3://npm-registry-packages"},"readme":"quantize\n========\n\nNode.js module for color quantization, based on Leptonica.\n\n\nInstall\n-------\n\n\tnpm install quantize\n\nQuick Overview\n--------------\n\n### Usage\n\n```javascript\nvar quantize = require('quantize');\n\nvar arrayOfPixels = [[190,197,190], [202,204,200], [207,214,210], [211,214,211], [205,207,207]];\nvar maximumColorCount = 4;\n\nvar colorMap = quantize(arrayOfPixels, maximumColorCount);\n```\n\n* `arrayOfPixels` - An array of pixels (represented as [R,G,B arrays]) to quantize\n* `maxiumColorCount` - The maximum number of colours allowed in the reduced palette\n\n##### Reduced Palette\n\nThe `.palette()` method returns an array that contains the reduced color palette.\n\n```javascript\n// Returns the reduced palette\ncolorMap.palette(); \n// [[204, 204, 204], [208,212,212], [188,196,188], [212,204,196]]\n```\n\n##### Reduced pixel\n\nThe `.map(pixel)` method maps an individual pixel to the reduced color palette.\n\n```javascript\n// Returns the reduced pixel\ncolorMap.map(arrayOfPixels[0]);\n// [188,196,188]\n```\n\nAuthor\n------\n\n* [Olivier Lesnicki](https://github.com/olivierlesnicki)\n\nContributors\n------------\n\n* [Nick Rabinowitz](https://github.com/nrabinowitz)\n* [Mike Bostock](https://github.com/mbostock)\n\nLicense\n-------\n\nLicensed under the MIT License.\n","publish_time":1677288989110,"_cnpm_publish_time":1677288989110,"dist-tags":{"latest":"1.4.0"}}