{"_id":"get-rgba-palette","_rev":"15-f158df1dc726bf6a048811f7244333b2","name":"get-rgba-palette","description":"gets a palette of prominent colors from an array of pixels","dist-tags":{"latest":"2.0.1"},"versions":{"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":"mattdesl","email":"dave.des@gmail.com"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"dist":{"shasum":"908f267c83b04d1dde6cee37cdeb4692e03b7815","tarball":"https://registry.npmjs.org/get-rgba-palette/-/get-rgba-palette-1.0.1.tgz","integrity":"sha512-P0c32JcwHMFPeLlZYuB7JLuGXiN9n4MuXLC9DNDPmTYBQo9jPDLWBGR4uIUUKl+/zeJxok5gzSYGunEVz9fDcA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClHF3oD9hjaeK64NI/iHnAoNMRzZ8Q7iLdKU/cEo5XdgIgWHywxej771vVnGadI5Q2UAn31+wAu1G3h5amXszt+7k="}]}},"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":"mattdesl","email":"dave.des@gmail.com"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"dist":{"shasum":"c786fd7f7c8539f1d3994ae5ae7709b8f2f7e4cc","tarball":"https://registry.npmjs.org/get-rgba-palette/-/get-rgba-palette-1.0.2.tgz","integrity":"sha512-3aD7KC5JO9ypxYVZam8NsrHglof7ZyXv5xXiqqRJfqnjfIwShfxVxlB4WJH8NFjNFaGYixugdmXBQ0UZcyCykw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkCdRYR05Oox4srO+Xg8YE9wtdzTPci8O+xE8N7H0k2gIgbL4CHOKgrdEkxHBudbsqpX5ER9IJWT1Ci4BpyENXVJU="}]}},"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":"mattdesl","email":"dave.des@gmail.com"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"dist":{"shasum":"da30aa2c9287e1023987d6f17a62d3f1f689f82a","tarball":"https://registry.npmjs.org/get-rgba-palette/-/get-rgba-palette-1.0.3.tgz","integrity":"sha512-J8Bdsl5X+wGjGfZ0yn5YTsgz1x7G/hf6NCa2UYIoo8PUMIKi/w3ou2H+vap68jARqfT+tcsc8+YojSMbWQhOcA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFCZ0Y5+bdvREXLQK9vEgZJFxQWlL/2Sm5ilKORZeeLwAiEA+lgzhwAwHlCUHJYIFLGgU5KdtivWpZKDuqk86aNW2AA="}]}},"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":"mattdesl","email":"dave.des@gmail.com"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"dist":{"shasum":"422fb18f3c0455ca2d3326e7182d9e2993678783","tarball":"https://registry.npmjs.org/get-rgba-palette/-/get-rgba-palette-1.0.4.tgz","integrity":"sha512-QbATG5YoffSxaRssuu0J/zVMcgP/mxg5zG/PGxzE7GUACiXcKkvjazJbXVmYooC/NwAjjkZglNlsl0lbFy2aag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoiC9l0fahfGVbfOFkaC5L6sXbm4AJChtP0oc4tRov/QIhANPUJ9UETQH+c8Nyx2c7Y1v+Sb8njPuZRfW6Z2LEC488"}]}},"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":"mattdesl","email":"dave.des@gmail.com"},"dist":{"shasum":"67477d2b72612966505203dbc90691c1e6ba3eee","tarball":"https://registry.npmjs.org/get-rgba-palette/-/get-rgba-palette-2.0.0.tgz","integrity":"sha512-LgkF5UjA0s29m+A8j1hJAenm+222MQCVdKVzaN0H5Ij6B7RLhYjAPFoZBBCfFSqKCr4L08Vmnyw8z5mH53OjQw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG0KFJTfpE5LO/cIi5DUwKENiXHp1DQgZevXNHBcwQ9CAiEAqBT1VDS8bjxhDxxpGObTX9Oq4mWIUm1hggAliRnGaPI="}]},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"cheapsteak","email":"garnwraly@gmail.com"}]},"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":"mattdesl","email":"dave.des@gmail.com"},"dist":{"shasum":"5ce70f75c6ef52882f54dd079e5ed68b5a2323ca","tarball":"https://registry.npmjs.org/get-rgba-palette/-/get-rgba-palette-2.0.1.tgz","integrity":"sha512-rYbQg/u2tGnRYWuYHNMcF/nDg0WakAbQRiYLM86AE96d2MA0oYPaphsuywSoYajG0PImMZEEjKbtY4UuL/620A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHwoLvgyv8ahETD7W4kojhzKpwrbYaXdTEb1+mW5Y99JAiEAydTYRyijQwwFxMyyOpK+nV8rgLXV6eL+SSPxTjQqCWs="}]},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"cheapsteak","email":"garnwraly@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/get-rgba-palette-2.0.1.tgz_1484750910787_0.6218754216097295"}}},"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.\n","maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"cheapsteak","email":"garnwraly@gmail.com"}],"time":{"modified":"2022-06-18T07:53:58.592Z","created":"2014-11-09T21:25:07.009Z","1.0.1":"2014-11-09T21:25:07.009Z","1.0.2":"2014-11-09T21:27:56.175Z","1.0.3":"2014-11-09T21:32:56.907Z","1.0.4":"2014-11-09T22:47:47.977Z","2.0.0":"2015-08-21T21:47:01.813Z","2.0.1":"2017-01-18T14:48:31.025Z"},"homepage":"https://github.com/mattdesl/get-rgba-palette","keywords":["get","image","palette","palet","pallet","pallette","colors","primary","main","quantize","pixels"],"repository":{"type":"git","url":"git://github.com/mattdesl/get-rgba-palette.git"},"author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"bugs":{"url":"https://github.com/mattdesl/get-rgba-palette/issues"},"license":"MIT","readmeFilename":"README.md","users":{"zeke":true,"travm":true}}