{"name":"@lokesh.dhakar/quantize","version":"1.4.0","description":"A node.js module for color quantization, based on Leptonica.","homepage":"https://github.com/olivierlesnicki/quantize","author":{"name":"Olivier Lesnicki","url":"https://github.com/olivierlesnicki"},"keywords":["image","quantize","color","node"],"contributors":[{"name":"Nick Rabinowitz","url":"https://github.com/nrabinowitz"},{"name":"Olivier Lesnicki","url":"https://github.com/olivierlesnicki"}],"license":"MIT","source":"src/quantize.js","main":"dist/index.js","module":"dist/index.mjs","scripts":{"build":"microbundle --no-compress --no-sourcemap","watch":"microbundle --no-compress --no-sourcemap watch","test":"jest"},"devDependencies":{"jest":"^29.7.0","microbundle":"^0.15.1"},"repository":{"type":"git","url":"git+https://github.com/lokesh/quantize.git"},"bugs":{"url":"https://github.com/lokesh/quantize/issues"},"_id":"@lokesh.dhakar/quantize@1.4.0","gitHead":"270c6f81623c3247eed50ba37b9d74d79af7a267","_nodeVersion":"22.8.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-+//cqVWKis//t0YH62EDtwaFSPG/CDtYNg4CZmzNmG2d5W17Iu3fuDAdpQXCDHUDrrU9q0veze4A7tPZXlR/mg==","shasum":"20bf62a8c34fa32d8e074bad1dacafd7dd5e026a","tarball":"http://registry-npm.ywwl.com/@lokesh.dhakar/quantize/download/@lokesh.dhakar/quantize-1.4.0.tgz","fileCount":7,"unpackedSize":78507,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0mpXoKtlPubdnQUA3W4vjWRzWUP/0UGP9ekVGJKmOxAIhAMJAd7ejUqQ4wS7JmbhZBn8+1DsXOJsUNmkjJ8CQycms"}],"size":11054,"noattachment":false,"key":"/@lokesh.dhakar/quantize/-/@lokesh.dhakar/quantize-1.4.0.tgz"},"_npmUser":{"name":"lokesh.dhakar","email":"lokesh.dhakar@gmail.com"},"directories":{},"maintainers":[{"name":"lokesh.dhakar","email":"lokesh.dhakar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quantize_1.4.0_1728060565838_0.004078507585032254"},"_hasShrinkwrap":false,"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":1728060566017,"_cnpm_publish_time":1728060566017,"dist-tags":{"latest":"1.4.0"}}