{"versions":{"2.0.1":{"name":"get-rgba-palette","version":"2.0.1","description":"gets a palette of prominent colors from an array of pixels","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"quantize":"^1.0.1"},"devDependencies":{"array-range":"^1.0.1","almost-equal":"0.0.0","tape":"^3.0.2"},"scripts":{"test":"node test.js"},"keywords":["get","image","palette","palet","pallet","pallette","colors","primary","main","quantize","pixels"],"repository":{"type":"git","url":"git://github.com/mattdesl/get-rgba-palette.git"},"homepage":"https://github.com/mattdesl/get-rgba-palette","bugs":{"url":"https://github.com/mattdesl/get-rgba-palette/issues"},"gitHead":"351cf830c2b64dd6b53055ad8d4527deb9f52a3c","_id":"get-rgba-palette@2.0.1","_shasum":"5ce70f75c6ef52882f54dd079e5ed68b5a2323ca","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.4","_npmUser":{"name":"anonymous","email":"dave.des@gmail.com"},"dist":{"shasum":"5ce70f75c6ef52882f54dd079e5ed68b5a2323ca","size":2898,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/get-rgba-palette/-/get-rgba-palette-2.0.1.tgz","integrity":"sha512-rYbQg/u2tGnRYWuYHNMcF/nDg0WakAbQRiYLM86AE96d2MA0oYPaphsuywSoYajG0PImMZEEjKbtY4UuL/620A=="},"maintainers":[{"name":"anonymous","email":"dave.des@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/get-rgba-palette-2.0.1.tgz_1484750910787_0.6218754216097295"},"directories":{},"publish_time":1484750911025,"_hasShrinkwrap":false,"_cnpm_publish_time":1484750911025,"_cnpmcore_publish_time":"2021-12-17T15:15:26.135Z","contributors":[]},"2.0.0":{"name":"get-rgba-palette","version":"2.0.0","description":"gets a palette of prominent colors from an array of pixels","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"quantize":"^1.0.1"},"devDependencies":{"array-range":"^1.0.1","almost-equal":"0.0.0","tape":"^3.0.2"},"scripts":{"test":"node test.js"},"keywords":["get","image","palette","palet","pallet","pallette","colors","primary","main","quantize","pixels"],"repository":{"type":"git","url":"git://github.com/mattdesl/get-rgba-palette.git"},"homepage":"https://github.com/mattdesl/get-rgba-palette","bugs":{"url":"https://github.com/mattdesl/get-rgba-palette/issues"},"gitHead":"a9b06f94f44f4591d6e36f7cb62520bdc69973a7","_id":"get-rgba-palette@2.0.0","_shasum":"67477d2b72612966505203dbc90691c1e6ba3eee","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.32","_npmUser":{"name":"anonymous","email":"dave.des@gmail.com"},"dist":{"shasum":"67477d2b72612966505203dbc90691c1e6ba3eee","size":2874,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/get-rgba-palette/-/get-rgba-palette-2.0.0.tgz","integrity":"sha512-LgkF5UjA0s29m+A8j1hJAenm+222MQCVdKVzaN0H5Ij6B7RLhYjAPFoZBBCfFSqKCr4L08Vmnyw8z5mH53OjQw=="},"maintainers":[{"name":"anonymous","email":"dave.des@gmail.com"}],"directories":{},"publish_time":1440193621813,"_hasShrinkwrap":false,"_cnpm_publish_time":1440193621813,"_cnpmcore_publish_time":"2021-12-17T15:15:26.348Z","contributors":[]},"1.0.4":{"name":"get-rgba-palette","version":"1.0.4","description":"gets a palette of prominent colors from an array of pixels","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"quantize":"^1.0.1"},"devDependencies":{"array-range":"^1.0.1","almost-equal":"0.0.0","tape":"^3.0.2"},"scripts":{"test":"node test.js"},"keywords":["get","image","palette","palet","pallet","pallette","colors","primary","main","quantize","pixels"],"repository":{"type":"git","url":"git://github.com/mattdesl/get-rgba-palette.git"},"homepage":"https://github.com/mattdesl/get-rgba-palette","bugs":{"url":"https://github.com/mattdesl/get-rgba-palette/issues"},"gitHead":"c0d24120ce389085873d2bd53c6fe4117ce66f02","_id":"get-rgba-palette@1.0.4","_shasum":"422fb18f3c0455ca2d3326e7182d9e2993678783","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"anonymous","email":"dave.des@gmail.com"},"maintainers":[{"name":"anonymous","email":"dave.des@gmail.com"}],"dist":{"shasum":"422fb18f3c0455ca2d3326e7182d9e2993678783","size":2719,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/get-rgba-palette/-/get-rgba-palette-1.0.4.tgz","integrity":"sha512-QbATG5YoffSxaRssuu0J/zVMcgP/mxg5zG/PGxzE7GUACiXcKkvjazJbXVmYooC/NwAjjkZglNlsl0lbFy2aag=="},"directories":{},"publish_time":1415573267977,"_hasShrinkwrap":false,"_cnpm_publish_time":1415573267977,"_cnpmcore_publish_time":"2021-12-17T15:15:26.747Z","contributors":[]},"1.0.3":{"name":"get-rgba-palette","version":"1.0.3","description":"gets a palette of prominent colors from an array of pixels","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"quantize":"^1.0.1"},"devDependencies":{"array-range":"^1.0.1","almost-equal":"0.0.0","tape":"^3.0.2"},"scripts":{"test":"node test.js"},"keywords":["get","image","palette","palet","pallet","pallette","colors","primary","main","quantize","pixels"],"repository":{"type":"git","url":"git://github.com/mattdesl/get-rgba-palette.git"},"homepage":"https://github.com/mattdesl/get-rgba-palette","bugs":{"url":"https://github.com/mattdesl/get-rgba-palette/issues"},"gitHead":"0e3322ef5f265401edb1c8d47d8a14a6a2810e8d","_id":"get-rgba-palette@1.0.3","_shasum":"da30aa2c9287e1023987d6f17a62d3f1f689f82a","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"anonymous","email":"dave.des@gmail.com"},"maintainers":[{"name":"anonymous","email":"dave.des@gmail.com"}],"dist":{"shasum":"da30aa2c9287e1023987d6f17a62d3f1f689f82a","size":2721,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/get-rgba-palette/-/get-rgba-palette-1.0.3.tgz","integrity":"sha512-J8Bdsl5X+wGjGfZ0yn5YTsgz1x7G/hf6NCa2UYIoo8PUMIKi/w3ou2H+vap68jARqfT+tcsc8+YojSMbWQhOcA=="},"directories":{},"publish_time":1415568776907,"_hasShrinkwrap":false,"_cnpm_publish_time":1415568776907,"_cnpmcore_publish_time":"2021-12-17T15:15:26.966Z","contributors":[]},"1.0.2":{"name":"get-rgba-palette","version":"1.0.2","description":"gets a palette of prominent colors from an array of pixels","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"quantize":"^1.0.1"},"devDependencies":{"array-range":"^1.0.1","almost-equal":"0.0.0","tape":"^3.0.2"},"scripts":{"test":"node test.js"},"keywords":["get","image","palette","palet","pallet","pallette","colors","primary","main","quantize","pixels"],"repository":{"type":"git","url":"git://github.com/mattdesl/get-rgba-palette.git"},"homepage":"https://github.com/mattdesl/get-rgba-palette","bugs":{"url":"https://github.com/mattdesl/get-rgba-palette/issues"},"gitHead":"4115deaae4067531dc72aaf86e12ad51a13ef7a3","_id":"get-rgba-palette@1.0.2","_shasum":"c786fd7f7c8539f1d3994ae5ae7709b8f2f7e4cc","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"anonymous","email":"dave.des@gmail.com"},"maintainers":[{"name":"anonymous","email":"dave.des@gmail.com"}],"dist":{"shasum":"c786fd7f7c8539f1d3994ae5ae7709b8f2f7e4cc","size":2680,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/get-rgba-palette/-/get-rgba-palette-1.0.2.tgz","integrity":"sha512-3aD7KC5JO9ypxYVZam8NsrHglof7ZyXv5xXiqqRJfqnjfIwShfxVxlB4WJH8NFjNFaGYixugdmXBQ0UZcyCykw=="},"directories":{},"publish_time":1415568476175,"_hasShrinkwrap":false,"_cnpm_publish_time":1415568476175,"_cnpmcore_publish_time":"2021-12-17T15:15:27.634Z","contributors":[]},"1.0.1":{"name":"get-rgba-palette","version":"1.0.1","description":"gets a palette of prominent colors from an array of pixels","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"array-range":"^1.0.1","quantize":"^1.0.1"},"devDependencies":{"almost-equal":"0.0.0","tape":"^3.0.2"},"scripts":{"test":"node test.js"},"keywords":["get","image","palette","palet","pallet","pallette","colors","primary","main","quantize","pixels"],"repository":{"type":"git","url":"git://github.com/mattdesl/get-rgba-palette.git"},"homepage":"https://github.com/mattdesl/get-rgba-palette","bugs":{"url":"https://github.com/mattdesl/get-rgba-palette/issues"},"gitHead":"eb2e27ae0f479c5b2b85c2092af2648608a77062","_id":"get-rgba-palette@1.0.1","_shasum":"908f267c83b04d1dde6cee37cdeb4692e03b7815","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"anonymous","email":"dave.des@gmail.com"},"maintainers":[{"name":"anonymous","email":"dave.des@gmail.com"}],"dist":{"shasum":"908f267c83b04d1dde6cee37cdeb4692e03b7815","size":2658,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/get-rgba-palette/-/get-rgba-palette-1.0.1.tgz","integrity":"sha512-P0c32JcwHMFPeLlZYuB7JLuGXiN9n4MuXLC9DNDPmTYBQo9jPDLWBGR4uIUUKl+/zeJxok5gzSYGunEVz9fDcA=="},"directories":{},"publish_time":1415568307009,"_hasShrinkwrap":false,"_cnpm_publish_time":1415568307009,"_cnpmcore_publish_time":"2021-12-17T15:15:27.851Z","contributors":[]}},"dist-tags":{"latest":"2.0.1"},"name":"get-rgba-palette","time":{"created":"2022-01-27T02:24:20.714Z","modified":"2022-01-27T02:24:20.714Z","2.0.1":"2017-01-18T14:48:31.025Z","2.0.0":"2015-08-21T21:47:01.813Z","1.0.4":"2014-11-09T22:47:47.977Z","1.0.3":"2014-11-09T21:32:56.907Z","1.0.2":"2014-11-09T21:27:56.175Z","1.0.1":"2014-11-09T21:25:07.009Z"},"readme":"# get-rgba-palette\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nGets a palette of prominent colors from a flat array of RGBA pixels.\n\n![img](http://i.imgur.com/arnLlX0.png)\n\nFull example: \n\n```js\nvar palette = require('get-rgba-palette')\nvar pixels = require('get-image-pixels')\nvar load = require('img')\nvar baboon = require('baboon-image-uri')\n\nload(baboon, function(err, img) {\n    //get flat RGBA pixels array\n    var px = pixels(img)\n\n    //get 5 prominent colors from our image\n    var colors = palette(px, 5)\n})\n```\n\n[RequireBin demo](http://requirebin.com/?gist=1f49e56f22fa9caa94d7)\n\nReturns RGB colors in the form of:  \n\n```[ [255, 0, 0], [128, 23, 52], [124, 0, 62], etc.. ]``` \n\n## Usage\n\n[![NPM](https://nodei.co/npm/get-rgba-palette.png)](https://nodei.co/npm/get-rgba-palette/)\n\n#### `palette(pixels[, count, quality, filter])`\n\nGets an array of RGB colors from an image (`pixels` is a flat RGBA array). Defaults to a `count` of 5 colors and a `quality` setting of 10. \n\n`quality` determines the step between each pixel when computing the quantization; higher number means fuzzier quality. Must be > 0.\n\n`filter` allows you to threshold the RGBA values given to the quantize function. It passes `(pixels, index)` -- the flat array and index to the RGBA component. Return true to accept the color, or false to reject.\n\nIf not specified, the filter function defaults to:\n\n```js\nfunction filter (pixels, index) {\n  // offset 3 --> alpha\n  return pixels[index + 3] >= 127\n}\n```\n\n#### `palette.bins(pixels[, count, quality, filter])`\n\nInstead of returning RGB colors, this returns the \"bins\" for each computed color. This can give you a very rough overview of the distribution of colours in the image. This is fairly arbitrary as the bin `size` does not always represent the exact number of pixels for that color in the image.\n\nReturns an array of objects:\n\n```js\n{\n    color: [255, 0, 0],\n    size: 12414,\n    amount: 0.65\n}\n```\n\nWhere `amount` is a percentage for that bin, normalized from the sum of the sizes in the returned bins.\n\n## License\n\nMIT, see [LICENSE.md](http://github.com/mattdesl/get-rgba-palette/blob/master/LICENSE.md) for details.","users":{}}