{"_id":"@davidegheri/gm-palette","_rev":"6-0c91d1faf5a0decd544c8a2c99ac42b3","name":"@davidegheri/gm-palette","dist-tags":{"latest":"4.0.1","beta":"4.0.0-beta.0"},"versions":{"1.1.0":{"name":"@davidegheri/gm-palette","description":"Dominant color and palette using graphicsmagick.","version":"1.1.0","license":"MIT","source":"dist-src/index.js","types":"dist-types/index.d.ts","main":"dist-node/index.js","pika":true,"sideEffects":false,"keywords":["dominant color","colors","top colors","palette","image colors","gm colors","gm palette","graphicsmagick"],"homepage":"https://github.com/Davide-Gheri/gm-palette#readme","bugs":{"url":"https://github.com/Davide-Gheri/gm-palette/issues"},"contributors":[{"name":"Akash Dathan"},{"name":"Davide Gheri"}],"repository":{"type":"git","url":"git+https://github.com/Davide-Gheri/gm-palette.git"},"dependencies":{"gm":"^1.23.1"},"devDependencies":{"@pika/pack":"^0.3.4","@pika/plugin-build-node":"^0.3.13","@pika/plugin-copy-assets":"^0.3.13","@pika/plugin-ts-standard-pkg":"^0.3.13","@types/gm":"^1.18.2","@types/jest":"^24.0.9","@types/lodash":"^4.14.92","@types/node":"^9.3.0","jest":"^24.1.0","ts-jest":"^24.0.0","ts-node":"^8.0.2","tslint":"^5.13.1","typescript":"^3.3.3333"},"licenseText":"MIT License\n\nCopyright (c) 2018 Akash Dathan\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@davidegheri/gm-palette@1.1.0","dist":{"shasum":"7e7c589afbeb114bc73c105ec7ac19954bb75b57","integrity":"sha512-qDnK7W7h5NyDpoCdv2H4qJOMp7MGz+rgxXQVKuVqmt52+Co7X/mRHUv5pYLJ5sZzSC9knF2WCFCEfSyqGLG00Q==","tarball":"https://registry.npmjs.org/@davidegheri/gm-palette/-/gm-palette-1.1.0.tgz","fileCount":17,"unpackedSize":19924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcflszCRA9TVsSAnZWagAAES0P/0K1QtWwjyNTaRjTa9mD\n1FTputGI9rc5O7G3e4Ru131prW3pYWYCMjE1PYlVFv6CCOKpTMEuHmdLsR/S\nnqdLwI6nIlunqgTB4s9IPqfjbFhOjkkzU0T+VLul7B8VNORTkv/Ir+Lkpf9Q\nzimYyFecCQ3ShYL1O9Gl4lC0kOBlR53AlqkiqFeW9tVVyFJv5BwrvC3LSR9Q\n3Sg7DnQJnkc3LE15EKf9sIrEsxcP+cbngVXlk/BmeyrIT/Vm1uy/F/yEPs6X\nV7r1xtKRRLRa3CIKyr+bSLS1fAv0fpNgE5idm19Zv8pdW5yrg4CW5KQTL3WG\nTHsSTYmW9f5KBSyi35Zv/9gRf1Aho3tgZdA2W2ZU0SobKF9OvtM2KKSk596L\n5mWfNL7t9k9GbyWv2cHIaezkR2PP6+x03KTReMBusXQ5HWZjitCqPDwMt5Jg\nzGdiZcyiU4FTsxWiT9fUjjuRAnORknEmTGvTELgoPzTBu+w/Gq9Ic+IqCEoa\neRnmJ/KgMXb4+q1bhWenJntJtomxZeGj+Y/CRcL9lWWWfB38JODRiYx++umm\ngqCFH/F0lrjNrEKWqDP/fGt8jj13Qwoon2Zk3SlhfPXJQ0VQPLgxVB/2CWSZ\nN5DAeJs+4VAUidmFZfrYDHot4GGpcQ8wfbAdORETXDVdPYJFfOeqi3qv8dnK\n/FhY\r\n=BCNI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBBzdxnF9TwV0OZVpkwYzyqLlgErGQnhRQ2hnoPU3b0vAiEAxi/Azp6LCwUVaSJn13pB+imxMLg6ecshBy9iwpWUdSA="}]},"maintainers":[{"name":"davide-gheri","email":"davide@davidegheri.com"}],"_npmUser":{"name":"davide-gheri","email":"davide@davidegheri.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gm-palette_1.1.0_1551784755134_0.5352804699410372"},"_hasShrinkwrap":false},"2.0.0":{"name":"@davidegheri/gm-palette","description":"Dominant color and palette using graphicsmagick.","version":"2.0.0","license":"MIT","bin":{"gm-palette":"dist-node/index.bin.js"},"source":"dist-src/index.js","types":"dist-types/index.d.ts","main":"dist-node/index.js","pika":true,"sideEffects":false,"keywords":["dominant color","colors","top colors","palette","image colors","gm colors","gm palette","graphicsmagick"],"homepage":"https://github.com/Davide-Gheri/gm-palette#readme","bugs":{"url":"https://github.com/Davide-Gheri/gm-palette/issues"},"contributors":[{"name":"Akash Dathan"},{"name":"Davide Gheri"}],"repository":{"type":"git","url":"git+https://github.com/Davide-Gheri/gm-palette.git"},"dependencies":{"commander":"^2.19.0","gm":"^1.23.1"},"devDependencies":{"@pika/pack":"^0.3.4","@pika/plugin-build-node":"^0.3.13","@pika/plugin-copy-assets":"^0.3.13","@pika/plugin-simple-bin":"^0.3.13","@pika/plugin-ts-standard-pkg":"^0.3.13","@types/gm":"^1.18.2","@types/jest":"^24.0.9","@types/lodash":"^4.14.92","@types/node":"^11.10.4","coveralls":"^3.0.3","jest":"^24.1.0","ts-jest":"^24.0.0","ts-node":"^8.0.2","tslint":"^5.13.1","typescript":"^3.3.3333"},"licenseText":"MIT License\n\nCopyright (c) 2018 Akash Dathan\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@davidegheri/gm-palette@2.0.0","dist":{"shasum":"35e4c63123a5d249a1ff31a5da9e1b6721dc9426","integrity":"sha512-wEdjqyENrgmLHCI4YSmmJ3Bh7PUEhYhS9dPpg/Jt0dnfVW7+L6RrNOwXlOcBsVFs3IdY1jmAonHSwSZmRgnxtA==","tarball":"https://registry.npmjs.org/@davidegheri/gm-palette/-/gm-palette-2.0.0.tgz","fileCount":21,"unpackedSize":24988,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf4eHCRA9TVsSAnZWagAACZoP/R1/JZanZmsTK+ZyP072\nBWvwN37gffLFuVJ2d1t49wmtSmTTLbDNcgyMeNd3fSgVxk3y6G0y7wsuqr3/\n9phXHzt5vf5vwsmrQgqGAHH6Pct72+yDU42xlmbAbN/LwPAHwJyvmV7dbcHI\n7u221eMeC+ZVdTBkzcLg+pSFT4c+j3d+0ipOjoEHyQ7US3HydhCV9abj2Lpd\nFVCtGwaOF5eqab2x4UNEn6xOP2KLtCyIcZvKlewx3IqToRMxzYGBKhNpJxqS\nVZaQsTsZrjeK83FgZjs8+mfJ+qipJrT0XLpamLWhBN5RtG0hj7XFxai0yZ7z\n4Iv6Ugy5Vs1TGdVpDpkv6I0sDWVQcIibZWB52LutS7bjP6cNLzkUjp2GIS6N\nTmgn28e8Unhv7cNvsz0pTHLPvY2GZjF8HTN/OdsHIA1BRJRAMX1ya+R+DETx\nmreOECFIiZ5Dy+l8JiQx6flD9hCujKidl7F/+VgS/tWlwEcfQQp1rMYqIOep\nrKTQyRc2oyJMbhgy6y0OafZe+g05LfAGdw+9f/S4RHC3GqDCJdV/jDlO1x0p\n6pp2isgvWnZpp7WN/gV1LG82HMk5rDrsJdi5PSVKMjzx0UqCZ9tC7GumWgfw\ngd+BJQL7/YTCsaTf3k31RDr/AyD1exok0RrcxPdSZzOdYe37R3K9/f464tZT\nwvHQ\r\n=8auk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyrqOOpIE/GjBekUXBDRmR/cw4WuxUk5aOmZT5WE9ywwIgGY5xh9bNQsYxuWiquEpaScaoF2TctNO0ZuyA5lPUXiQ="}]},"maintainers":[{"name":"davide-gheri","email":"davide@davidegheri.com"}],"_npmUser":{"name":"davide-gheri","email":"davide@davidegheri.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gm-palette_2.0.0_1551861638868_0.5695555530521992"},"_hasShrinkwrap":false},"3.0.0":{"name":"@davidegheri/gm-palette","description":"Dominant color and palette using graphicsmagick.","version":"3.0.0","license":"MIT","bin":{"gm-palette":"dist-node/index.bin.js"},"source":"dist-src/index.js","types":"dist-types/index.d.ts","main":"dist-node/index.js","pika":true,"sideEffects":false,"keywords":["dominant color","colors","top colors","palette","image colors","gm colors","gm palette","graphicsmagick"],"homepage":"https://github.com/Davide-Gheri/gm-palette#readme","bugs":{"url":"https://github.com/Davide-Gheri/gm-palette/issues"},"contributors":[{"name":"Akash Dathan"},{"name":"Davide Gheri"}],"repository":{"type":"git","url":"git+https://github.com/Davide-Gheri/gm-palette.git"},"dependencies":{"commander":"^2.19.0","gm":"^1.23.1"},"devDependencies":{"@pika/pack":"^0.3.4","@pika/plugin-build-node":"^0.3.13","@pika/plugin-copy-assets":"^0.3.13","@pika/plugin-simple-bin":"^0.3.13","@pika/plugin-ts-standard-pkg":"^0.3.13","@types/gm":"^1.18.2","@types/jest":"^24.0.9","@types/lodash":"^4.14.92","@types/node":"^11.10.4","coveralls":"^3.0.3","jest":"^24.1.0","ts-jest":"^24.0.0","ts-node":"^8.0.2","tslint":"^5.13.1","typescript":"^3.3.3333"},"licenseText":"MIT License\n\nCopyright (c) 2018 Akash Dathan\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@davidegheri/gm-palette@3.0.0","dist":{"shasum":"3b5581a1a015574a51346b416347e1b746f7f5e2","integrity":"sha512-YeVfeiCj9F9XUL4IGXcGLBEOeqikr8+Fb0l58JrlMoiPH/izeqvFj2SIHjKX/xz1nuBm7KYEez3nPJ9c74Z1qA==","tarball":"https://registry.npmjs.org/@davidegheri/gm-palette/-/gm-palette-3.0.0.tgz","fileCount":30,"unpackedSize":37014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgNQACRA9TVsSAnZWagAAcvUQAJipMtL+dMKi52DBwcON\nDkKVRhh6VybTs7+DkXDZeV1nSd05YA09hpNspE0ASVnhmcCYaDlqWGC5qkMK\n4VBTx9o4Ry8D80dWPMqO9WHrm0LHbiPKlw+gg2MUeDtXcbYILHx7fjD/pDGM\nLrhYLTrPBNydfBcF8DFTc852JVJnwV6cNWZ6UY8/Hdw3Ar6Gl//Nbb6uKv8c\nXiLHbjFAC7uTtbd4erbhUndabIA/7XBbYgJLu3JcRmowYmoiiCcckyBRqu47\nMKBLaewFy0zHezDPraA3uLvmzXXLiTLOxFLY2qai8esu4N8hfw5LaomOu5sv\nO60vijGU0owDXsh+316h+JYnSNeFy0KHThcXkovG8stD0hj7yA+B9pGDQnak\ncIseDPURKQ52+M+P159CzU1Q0Wfwo9KCCJJiaTcP9VJB4kJu8JmTTkXixrLp\nw8N9vu8CL5J4W1E3VILoiWzOfsrhM9VHLLmIh4X/6IWkxUaiQ6hxziortD9D\nLJNMlCpMR0H+oeup3GjFMcpxe4Z0h/CupBJMqvOjx+oCbJ1n1ia+F+qtstTy\niOWp2+VYSr+kkdyP8DU+aSBs8UBxc3coCmeznCmrYdLiUNO31xC+xmsACx1D\nvJKwqo43u80UaOAvI4iDRWovz9CTUfp2Pm3N6XmDa2gtJ9yDdKa7v4t4l2pn\nHiC9\r\n=DZBG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcgK7bfcnNJCEOe/2lt2Tn1p+qt7kAH7KL3Yn4qA9SnAIgb5g3aCxnQqFes9MuT96l3UyLUpm/vqPmdIGUY5d986k="}]},"maintainers":[{"name":"davide-gheri","email":"davide@davidegheri.com"}],"_npmUser":{"name":"davide-gheri","email":"davide@davidegheri.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gm-palette_3.0.0_1551946751564_0.2049946954716595"},"_hasShrinkwrap":false},"4.0.0-beta.0":{"name":"@davidegheri/gm-palette","version":"4.0.0-beta.0","description":"Dominant color and palette using graphicsmagick.","main":"./dist/node/index.js","typings":"./dist/types/index.d.ts","module":"./dist/src/index.js","bin":{"gm-palette":"./dist/node/bin/index.js"},"scripts":{"test":"jest","test:coverage":"jest --coverage","test:coveralls":"jest --coverage --coverageReporters=text-lcov | coveralls","lint":"tslint -p tsconfig.json -c tslint.json","build:clean":"rimraf ./dist","build:es":"tsc -p tsconfig.es.json","build:node":"tsc -p tsconfig.node.json","build":"yarn build:clean && yarn build:node && yarn build:es","preversion":"yarn test && yarn lint","version":"yarn build"},"repository":{"type":"git","url":"git+https://github.com/Davide-Gheri/gm-palette.git"},"keywords":["dominant color","colors","top colors","palette","image colors","gm colors","gm palette","graphicsmagick"],"contributors":[{"name":"Akash Dathan"},{"name":"Davide Gheri"}],"license":"MIT","bugs":{"url":"https://github.com/Davide-Gheri/gm-palette/issues"},"homepage":"https://github.com/Davide-Gheri/gm-palette#readme","dependencies":{"commander":"^2.19.0","gm":"^1.23.1"},"devDependencies":{"@types/gm":"^1.18.2","@types/jest":"^24.0.9","@types/lodash":"^4.14.92","@types/node":"^12.0.0","coveralls":"^3.0.3","jest":"^24.1.0","rimraf":"^2.6.3","ts-jest":"^24.0.0","ts-node":"^8.0.2","tslint":"^5.13.1","typescript":"^3.3.3333"},"jest":{"moduleFileExtensions":["js","ts"],"rootDir":"src","testRegex":".spec.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"coverageDirectory":"../coverage"},"readme":"# gm-palette\nDominant color and palette using graphicsmagick.\n\n[![Build Status](https://travis-ci.com/Davide-Gheri/gm-palette.svg?branch=master)](https://travis-ci.com/Davide-Gheri/gm-palette)\n[![Coverage Status](https://coveralls.io/repos/github/Davide-Gheri/gm-palette/badge.svg?branch=master)](https://coveralls.io/github/Davide-Gheri/gm-palette?branch=master)\n[![npm version](https://badge.fury.io/js/%40davidegheri%2Fgm-palette.svg)](https://badge.fury.io/js/%40davidegheri%2Fgm-palette) \n[![NPM license](http://img.shields.io/npm/l/@davidegheri/gm-palette.svg?style=flat)](https://www.npmjs.org/package/@davidegheri/gm-palette) \n[![Greenkeeper badge](https://badges.greenkeeper.io/Davide-Gheri/gm-palette.svg)](https://greenkeeper.io/)\n\n![orf](./samples/sample-image.jpg)\n\n## Getting started\nFirst download and install [GraphicsMagick](http://www.graphicsmagick.org/). In Mac OS X, you can simply use [Homebrew](http://mxcl.github.io/homebrew/) and do:\n\n```bash\n$ brew install graphicsmagick\n```\n\nthen use npm to install the module:\n\n```bash\n$ npm install @davidegheri/gm-palette\n```\n \n\n## Features\n\n* Retrieve dominant color and palette.\n* GIF format supported.\n* Provide the count of palette colors to obtain.\n* The input can be path to image, buffer or a readable stream\n* CLI script\n\n## Basic Usage\n\n```js\n\nconst gmPalette = require('@davidegehri/gm-palette')\n\n//If callback is not provided, Promise is returned.\ngmPalette.dominantColor('path/to/image.jpg', (error, data) => {\n  if (error) {\n      console.log('Error', error);\n  }\n  console.log('Result: ', data);\n\n  //{ r: 54, g: 56, b: 62 }\n});\n\n//If callback is not provided, Promise is returned.\ngmPalette.dominantColor('/path/to/animated.gif[0]', (error, data) => {\n  if (error) {\n      console.log('Error', error);\n  }\n  console.log('Result: ', data);\n\n  //{ r: 54, g: 56, b: 62 }\n});\n\n\nconst count = 10; // Optional number of palette colors, default 5\n//If callback is not provided, Promise is returned.\ngmPalette.palette('path/to/image.jpg', count,  (error, data) => { \n  // If count is not provided, a default value of 10 is taken.\n  if (error) {\n      console.log('Error', error);\n  }\n  console.log('Result: ', data);\n  /*\n  [ \n    { r: 28, g: 31, b: 38 },\n    { r: 59, g: 61, b: 66 },\n    { r: 62, g: 64, b: 69 },\n    { r: 64, g: 63, b: 70 },\n    { r: 65, g: 65, b: 63 },\n    { r: 72, g: 72, b: 78 },\n    { r: 122, g: 124, b: 130 },\n    { r: 125, g: 128, b: 132 },\n    { r: 155, g: 156, b: 159 },\n    { r: 214, g: 215, b: 217 }\n  ]\n  */\n});\n\n```\n\n## Buffer\n\n```js\n\nconst gmPalette = require('@davidegheri/gm-palette'),\n      imageBuffer = require('fs').readFileSync('/path/to/image.jpg'),\n      count = 10;\n\n\n//If callback is not provided, Promise is returned.\ngmPalette.dominantColor(imageBuffer, (error, data) => {\n  if (error) {\n      console.log('Error', error);\n  }\n  console.log('Result: ', data);\n\n  //{ r: 54, g: 56, b: 62 }\n});\n\n//If callback is not provided, Promise is returned.\ngmPalette.palette(imageBuffer, count,  (error, data) => { \n  if (error) {\n      console.log('Error', error);\n  }\n  console.log('Result: ', data);\n  /*\n  [ \n    { r: 28, g: 31, b: 38 },\n    { r: 59, g: 61, b: 66 },\n    { r: 62, g: 64, b: 69 },\n    { r: 64, g: 63, b: 70 },\n    { r: 65, g: 65, b: 63 },\n    { r: 72, g: 72, b: 78 },\n    { r: 122, g: 124, b: 130 },\n    { r: 125, g: 128, b: 132 },\n    { r: 155, g: 156, b: 159 },\n    { r: 214, g: 215, b: 217 }\n  ]\n  */\n})\n\n\n```\n\n## Stream\n\n```js\n\nconst gmPalette = require('@davidegheri/gm-palette'),\n      readableStream = fs.createReadStream('/path/to/my/img.jpg');\n\n//If callback is not provided, Promise is returned.\ngmPalette.dominantColor(readableStream, (error, data) => {\n  if (error) {\n      console.log('Error', error);\n  }\n  console.log('Result : ', data);\n\n  //{ r: 54, g: 56, b: 62 }\n})\n\n//If callback is not provided, Promise is returned.\ngmPalette.palette(readableStream, (error, data) => {\n  if (error) {\n      console.log('Error', error);\n  }\n  console.log('Result : ', data);\n  /*\n  [ \n    { r: 28, g: 31, b: 38 },\n    { r: 59, g: 61, b: 66 },\n    { r: 62, g: 64, b: 69 },\n    { r: 64, g: 63, b: 70 },\n    { r: 65, g: 65, b: 63 },\n  ]\n  */\n})\n\n```\n\n## GIF\nYou can get a base64 encoded string representing a 1x1px GIF filled with the dominant color\n```js\nconst gmPalette = require('@davidegheri/gm-palette');\n\n//If callback is not provided, Promise is returned.\ngmPalette.dominantColorGIF('path/to/image.jpg', (error, data) => {\n    if (error) {\n        console.log('Error', error);\n    }\n    console.log('Result: ', data);\n    \n    // data:image/gif;base64,R0lGODlhAQABAIABAEMsZgAAACwAAAAAAQABAAACAkQBAA==\n})\n``` \n\n## Cli\n\n**gm-palette** comes also with a handy Cli script:\n```bash\n$ npm i -g @davidegheri/gm-palette\n\n$ gm-palette path/to/img.jpg\n\n# [ \n#  { r: 28, g: 31, b: 38 },\n#  { r: 59, g: 61, b: 66 },\n#  { r: 62, g: 64, b: 69 },\n#  { r: 64, g: 63, b: 70 },\n#  #{ r: 65, g: 65, b: 63 },\n# ]\n```\nTo get the dominant color only:\n```bash\n$ gm-palette path/to/img.jpg --dominant\n# or\n$ gm-palette path/to/img.jpg -d\n\n# { r: 54, g: 56, b: 62 }\n```\nTo get the base64 encoded GIF:\n```bash\n$ gm-palette path/to/img.jpg --gif\n# or\n$ gm-palette path/to/img.jpg -g\n\n# data:image/gif;base64,R0lGODlhAQABAIABAEMsZgAAACwAAAAAAQABAAACAkQBAA==\n```\n","readmeFilename":"README.md","gitHead":"14057d18fd1d582aa075ac7a73eed5b96e7c76a9","_id":"@davidegheri/gm-palette@4.0.0-beta.0","_nodeVersion":"10.13.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-nxEmfgu+BaH8hrR3f2Vp+oX69H4JgR1TZthyLfIW3ObTURfTZGhrRXsGd3Hgxso4UXtAfv9aixiQG9EsVMn3CQ==","shasum":"367f9b1ddb8a8a0c56687023eacb037d1d07b25d","tarball":"https://registry.npmjs.org/@davidegheri/gm-palette/-/gm-palette-4.0.0-beta.0.tgz","fileCount":40,"unpackedSize":59423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdPr9sCRA9TVsSAnZWagAA2HwQAINjl6NJRMYnDnVKTKzS\n1L8oTVMap9hbWfPd2bNgVtdy92+VBfOim36brOgYu/kUB4CJ9P8WQ5dkG8Nj\nLDdljqznU0UMCX2Uqr0hgWTOcHJ0ZLzSvylx3Y5jrOvh6R8ULAuLqjReRLKG\nQG7UltnDhxQ/ylS2ij+t6L7St/vBie2896gFMC4PPpkvQVdBd0K92ewY8oWA\nNrVNF2cNVENOUp6hEIGA/8S9qAekFPIs7LyNU3yOrd5VhO1V4IQR4wrkHeSK\nArrUeFyphdMCbM4PkDYVvQ0rATb7hbwD/FstCTEJKXRxeuPRgKtiWRxC56A8\nCC8iuKhJTOrsCekoQKXCWZibXF0f+B+BYH3zYzpbRXFsrPNSx03bET52NVse\nPuoQbHPNeTx4kkZd4NLDC+IU1sLtmLCtCDOGs6Cyz2gIikg3jJH48PWNaPk4\nxTPC2CS5eEPapF5rE/inpdz5eOvZnjbEHeqkvJXjj9REM5gFzRb4ee1FczDN\nRgCYosiywNNbVOOoMooTTOEg3M89O8E+ZvWYYFKa+BeLy3bJFwUREychRYqS\nOm8AplhF24I1am8BQHQf0tdO6a0LM5sZSf7QpDTqNE9XBr0z6i/o7Kgi9LbY\nFD8M2h0hzaay0AxaX9R3I/It8/HcbpQse1b94JNwi5rXxS3EST0UVzPoZTii\nE7N3\r\n=ysKn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDqFmbtH2966DalIN4L+q+ISpvMRGNOPDtaJvhYGpbyuAiBNjj9qLxP64brWUrmyxf6XvhHoWT9PjdOI8cl3xgG5dw=="}]},"maintainers":[{"name":"davide-gheri","email":"davide@davidegheri.com"}],"_npmUser":{"name":"davide-gheri","email":"davide@davidegheri.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gm-palette_4.0.0-beta.0_1564393323710_0.6087355886743808"},"_hasShrinkwrap":false},"4.0.0":{"name":"@davidegheri/gm-palette","version":"4.0.0","description":"Dominant color and palette using graphicsmagick.","main":"./dist/node/index.js","typings":"./dist/types/index.d.ts","module":"./dist/src/index.js","bin":{"gm-palette":"./dist/node/bin/index.js"},"scripts":{"test":"jest","test:coverage":"jest --coverage","test:coveralls":"jest --coverage --coverageReporters=text-lcov | coveralls","lint":"tslint -p tsconfig.json -c tslint.json","build:clean":"rimraf ./dist","build:es":"tsc -p tsconfig.es.json","build:node":"tsc -p tsconfig.node.json","build":"yarn build:clean && yarn build:node && yarn build:es","preversion":"yarn test && yarn lint","version":"yarn build"},"repository":{"type":"git","url":"git+https://github.com/Davide-Gheri/gm-palette.git"},"keywords":["dominant color","colors","top colors","palette","image colors","gm colors","gm palette","graphicsmagick"],"contributors":[{"name":"Akash Dathan"},{"name":"Davide Gheri"}],"license":"MIT","bugs":{"url":"https://github.com/Davide-Gheri/gm-palette/issues"},"homepage":"https://github.com/Davide-Gheri/gm-palette#readme","dependencies":{"commander":"^2.19.0","gm":"^1.23.1"},"devDependencies":{"@types/gm":"^1.18.2","@types/jest":"^24.0.9","@types/lodash":"^4.14.92","@types/node":"^12.0.0","coveralls":"^3.0.3","jest":"^24.1.0","rimraf":"^2.6.3","ts-jest":"^24.0.0","ts-node":"^8.0.2","tslint":"^5.13.1","typescript":"^3.3.3333"},"jest":{"moduleFileExtensions":["js","ts"],"rootDir":"src","testRegex":".spec.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"coverageDirectory":"../coverage"},"gitHead":"bd17f4b910e4ac71ecf7d5acd0739f9b700bf4f8","_id":"@davidegheri/gm-palette@4.0.0","_nodeVersion":"10.13.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-GYIPioJjJRUGSiXbFl1AX84vfoZk1nQUA3qJK6lFnGDlqWRJ/uxigMiTDS9g2CCJHdKBnUZE3tjLmWNLpCETxw==","shasum":"6eceb849193c34008573d0be154baddcd1bb7f27","tarball":"https://registry.npmjs.org/@davidegheri/gm-palette/-/gm-palette-4.0.0.tgz","fileCount":40,"unpackedSize":59416,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdPsIiCRA9TVsSAnZWagAAQdsP/RmtI9PQomafF5F7HXg7\nXceX0qEOThDQG5HxOCt12BKqHnypBF98unt8Y+4+Ta/3Y9PVRcUozCS8nIcb\nzK+/qVib/vy8NIsy0pHUpCkgLHVhXnrfNzgG3iXeoylF8heJGn7Tp9DQrQJQ\nVIklpJEF4a+/2OJuFi6jnhRHxVg6UHCBaMNCvYexBWh/uWSNlfktm7O853+5\nnObkdZlfP+8SPZ/VCi58oH9uF+/ccjyUsbedj260fp3IAyaDjWhvE58QuDgK\nwxM8wLQO8YUep5NSEFF7hs74tDvcQVEyWvIpwj2vhsnuSHYnHrdDo7yQ3JNL\nMSU7XQduzwxNRVOCaRc+REOo5Ra4qmBydY71Q5NLO35ap0cFXEOu0jzfTBZ+\nYTaBOnNp6pP4AmTitizua6RJNqTLJQp6ijGm0ejmpdnbz9UinGMHIxokSPpq\nMkux25r5cydNvj7o78VOyBMpYeIvI5u3OsxR/h/83Ymg5www4wEhSi5nD75q\nbVaPSp62LpRpTnPsdHdjyGAOXq6AbMxpJJgpPuZE+yMf3Z7+DkQ6AaoJeyCf\nXjfM33ItGE9r/A9kwA+i35EyfaliFyT8F+tiOk9pUWS5HcyCXACHIuDwnEuH\nFFFDecic2iKK5V1U5gbZXT6cF8n7lKJ3/3VELGUtayxKvWXucUkp8aFD8792\nCDv5\r\n=XeO7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDemI1GR8ujqCas4nFHV/q4fIMl53tQhMvx2ruMDQ+Z8AIgWTU1uA486MZlXpnrSUkD5dN2a8VGSOjKXYNNXMzl4Nw="}]},"maintainers":[{"name":"davide-gheri","email":"davide@davidegheri.com"}],"_npmUser":{"name":"davide-gheri","email":"davide@davidegheri.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gm-palette_4.0.0_1564394017276_0.7879593098665767"},"_hasShrinkwrap":false},"4.0.1":{"name":"@davidegheri/gm-palette","version":"4.0.1","description":"Dominant color and palette using graphicsmagick.","main":"./dist/node/index.js","typings":"./dist/types/index.d.ts","module":"./dist/src/index.js","bin":{"gm-palette":"./dist/node/bin/index.js"},"scripts":{"test":"jest","test:coverage":"jest --coverage","test:coveralls":"jest --coverage --coverageReporters=text-lcov | coveralls","lint":"tslint -p tsconfig.json -c tslint.json","build:clean":"rimraf ./dist","build:es":"tsc -p tsconfig.es.json","build:node":"tsc -p tsconfig.node.json","build":"yarn build:clean && yarn build:node && yarn build:es","preversion":"yarn test && yarn lint","version":"yarn build"},"repository":{"type":"git","url":"git+https://github.com/Davide-Gheri/gm-palette.git"},"keywords":["dominant color","colors","top colors","palette","image colors","gm colors","gm palette","graphicsmagick"],"contributors":[{"name":"Akash Dathan"},{"name":"Davide Gheri"}],"license":"MIT","bugs":{"url":"https://github.com/Davide-Gheri/gm-palette/issues"},"homepage":"https://github.com/Davide-Gheri/gm-palette#readme","dependencies":{"commander":"^3.0.0","gm":"^1.23.1"},"devDependencies":{"@types/gm":"^1.18.4","@types/jest":"^24.0.9","@types/lodash":"^4.14.92","@types/node":"^12.0.0","coveralls":"^3.0.3","jest":"^24.1.0","rimraf":"^3.0.0","ts-jest":"^24.0.0","ts-node":"^8.0.2","tslint":"^5.13.1","typescript":"^3.3.3333"},"jest":{"moduleFileExtensions":["js","ts"],"rootDir":"src","testRegex":".spec.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"coverageDirectory":"../coverage"},"gitHead":"e1730721b3a0c2a4fa1f417883a6c2b43647dc54","_id":"@davidegheri/gm-palette@4.0.1","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Y+3g5a+7ZJn7EOQIhKmtSgE+RGwODTsibxamYLeD0y++V4swW7EOPCKa7Zsw5pKkDJH+ZOhSg8ySqwZPmmP3lw==","shasum":"921d85a41824a0b4a52231c600c22131f4138726","tarball":"https://registry.npmjs.org/@davidegheri/gm-palette/-/gm-palette-4.0.1.tgz","fileCount":40,"unpackedSize":59415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdY89MCRA9TVsSAnZWagAADTIP/jOlgFQQVFmrVIHE4jAv\nu1w4/IubKTCqtj9oajdT1iwxDrZiZiw5oL8Ws325NL9xVy6HZXloqb8Q6K2W\nGtHFrjPUvYksj1733vxUhKBUBh3Xz+Pgs0LhyLkmKwWQKRNUAGI7AUKd0Wlk\ncoQ4440ZQk5aS+/B0MIMrIF2ZIVnvrmXCddbuRe3tJ/6ZlzJfFP6AS1qUs16\nPHwTujYE2o0/sHFIDcbLomWLHhuWHn2m8a8jMVlF9F60k7lUiSMWMYYoowH/\ncvpfzWYcTYOsVq5G7waVgd/M+7PLDnPVc7rC38ONd4byPfJTbZOF0heAiHNj\nsDxrDdPjm7JCnjWi5UKmxJB5h/Q0ciFkqcpEkvfAAqJCLhQtJbrCSBRU/Oo8\nQWLlhBef6ZtZ6iK/8bUzrf5CoxoB2A6WQnUEeZ48FlF+x6Qk23+5nNVrn2Yz\nvb4JuBzx1cofe4VMS+d4M83rXX5cgvlu5wYe9fkG446/3Dn9nqKaXyYzmdKV\n39JKWwXm08N2cgBUxqtIHXJ7zyMmcxQBudrL6elXYNDNZn9Om+uLEA6LXfjM\nYdu2d/UANnKAp8Qd+4Q/2h8Tek+qYGdTAZ2Z1Cn9szOdt2A/ZuNe92HYYkRX\nIYM7uOBwPWPCnz2IbsaoHcLnaVw0TgHGPLM18ZuJYoGB00yK3SpHEivUT5vZ\nwk6a\r\n=YBE7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDC0xrMDGmn9Rr71C0aY9RjI++abHz3sZUiLZKJhZaP1QIgImLyvWQyxdmt2pIHVTANeUKJc096E4LsRfPg47rnDj8="}]},"maintainers":[{"name":"davide-gheri","email":"davide@davidegheri.com"}],"_npmUser":{"name":"davide-gheri","email":"davide@davidegheri.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gm-palette_4.0.1_1566822219726_0.6398929962123039"},"_hasShrinkwrap":false}},"time":{"created":"2019-03-05T11:19:15.077Z","1.1.0":"2019-03-05T11:19:15.378Z","modified":"2022-04-05T03:05:46.781Z","2.0.0":"2019-03-06T08:40:38.974Z","3.0.0":"2019-03-07T08:19:11.683Z","4.0.0-beta.0":"2019-07-29T09:42:03.846Z","4.0.0":"2019-07-29T09:53:37.441Z","4.0.1":"2019-08-26T12:23:39.852Z"},"maintainers":[{"name":"davide-gheri","email":"davide@davidegheri.com"}],"description":"Dominant color and palette using graphicsmagick.","homepage":"https://github.com/Davide-Gheri/gm-palette#readme","keywords":["dominant color","colors","top colors","palette","image colors","gm colors","gm palette","graphicsmagick"],"repository":{"type":"git","url":"git+https://github.com/Davide-Gheri/gm-palette.git"},"contributors":[{"name":"Akash Dathan"},{"name":"Davide Gheri"}],"bugs":{"url":"https://github.com/Davide-Gheri/gm-palette/issues"},"license":"MIT","readme":"# gm-palette\nDominant color and palette using graphicsmagick.\n\n[![Build Status](https://travis-ci.com/Davide-Gheri/gm-palette.svg?branch=master)](https://travis-ci.com/Davide-Gheri/gm-palette)\n[![Coverage Status](https://coveralls.io/repos/github/Davide-Gheri/gm-palette/badge.svg?branch=master)](https://coveralls.io/github/Davide-Gheri/gm-palette?branch=master)\n[![npm version](https://badge.fury.io/js/%40davidegheri%2Fgm-palette.svg)](https://badge.fury.io/js/%40davidegheri%2Fgm-palette) \n[![NPM license](http://img.shields.io/npm/l/@davidegheri/gm-palette.svg?style=flat)](https://www.npmjs.org/package/@davidegheri/gm-palette) \n[![Greenkeeper badge](https://badges.greenkeeper.io/Davide-Gheri/gm-palette.svg)](https://greenkeeper.io/)\n\n![orf](./samples/sample-image.jpg)\n\n## Getting started\nFirst download and install [GraphicsMagick](http://www.graphicsmagick.org/). In Mac OS X, you can simply use [Homebrew](http://mxcl.github.io/homebrew/) and do:\n\n```bash\n$ brew install graphicsmagick\n```\n\nthen use npm to install the module:\n\n```bash\n$ npm install @davidegheri/gm-palette\n```\n \n\n## Features\n\n* Retrieve dominant color and palette.\n* GIF format supported.\n* Provide the count of palette colors to obtain.\n* The input can be path to image, buffer or a readable stream\n* CLI script\n\n## Basic Usage\n\n```js\n\nconst gmPalette = require('@davidegehri/gm-palette')\n\n//If callback is not provided, Promise is returned.\ngmPalette.dominantColor('path/to/image.jpg', (error, data) => {\n  if (error) {\n      console.log('Error', error);\n  }\n  console.log('Result: ', data);\n\n  //{ r: 54, g: 56, b: 62 }\n});\n\n//If callback is not provided, Promise is returned.\ngmPalette.dominantColor('/path/to/animated.gif[0]', (error, data) => {\n  if (error) {\n      console.log('Error', error);\n  }\n  console.log('Result: ', data);\n\n  //{ r: 54, g: 56, b: 62 }\n});\n\n\nconst count = 10; // Optional number of palette colors, default 5\n//If callback is not provided, Promise is returned.\ngmPalette.palette('path/to/image.jpg', count,  (error, data) => { \n  // If count is not provided, a default value of 10 is taken.\n  if (error) {\n      console.log('Error', error);\n  }\n  console.log('Result: ', data);\n  /*\n  [ \n    { r: 28, g: 31, b: 38 },\n    { r: 59, g: 61, b: 66 },\n    { r: 62, g: 64, b: 69 },\n    { r: 64, g: 63, b: 70 },\n    { r: 65, g: 65, b: 63 },\n    { r: 72, g: 72, b: 78 },\n    { r: 122, g: 124, b: 130 },\n    { r: 125, g: 128, b: 132 },\n    { r: 155, g: 156, b: 159 },\n    { r: 214, g: 215, b: 217 }\n  ]\n  */\n});\n\n```\n\n## Buffer\n\n```js\n\nconst gmPalette = require('@davidegheri/gm-palette'),\n      imageBuffer = require('fs').readFileSync('/path/to/image.jpg'),\n      count = 10;\n\n\n//If callback is not provided, Promise is returned.\ngmPalette.dominantColor(imageBuffer, (error, data) => {\n  if (error) {\n      console.log('Error', error);\n  }\n  console.log('Result: ', data);\n\n  //{ r: 54, g: 56, b: 62 }\n});\n\n//If callback is not provided, Promise is returned.\ngmPalette.palette(imageBuffer, count,  (error, data) => { \n  if (error) {\n      console.log('Error', error);\n  }\n  console.log('Result: ', data);\n  /*\n  [ \n    { r: 28, g: 31, b: 38 },\n    { r: 59, g: 61, b: 66 },\n    { r: 62, g: 64, b: 69 },\n    { r: 64, g: 63, b: 70 },\n    { r: 65, g: 65, b: 63 },\n    { r: 72, g: 72, b: 78 },\n    { r: 122, g: 124, b: 130 },\n    { r: 125, g: 128, b: 132 },\n    { r: 155, g: 156, b: 159 },\n    { r: 214, g: 215, b: 217 }\n  ]\n  */\n})\n\n\n```\n\n## Stream\n\n```js\n\nconst gmPalette = require('@davidegheri/gm-palette'),\n      readableStream = fs.createReadStream('/path/to/my/img.jpg');\n\n//If callback is not provided, Promise is returned.\ngmPalette.dominantColor(readableStream, (error, data) => {\n  if (error) {\n      console.log('Error', error);\n  }\n  console.log('Result : ', data);\n\n  //{ r: 54, g: 56, b: 62 }\n})\n\n//If callback is not provided, Promise is returned.\ngmPalette.palette(readableStream, (error, data) => {\n  if (error) {\n      console.log('Error', error);\n  }\n  console.log('Result : ', data);\n  /*\n  [ \n    { r: 28, g: 31, b: 38 },\n    { r: 59, g: 61, b: 66 },\n    { r: 62, g: 64, b: 69 },\n    { r: 64, g: 63, b: 70 },\n    { r: 65, g: 65, b: 63 },\n  ]\n  */\n})\n\n```\n\n## GIF\nYou can get a base64 encoded string representing a 1x1px GIF filled with the dominant color\n```js\nconst gmPalette = require('@davidegheri/gm-palette');\n\n//If callback is not provided, Promise is returned.\ngmPalette.dominantColorGIF('path/to/image.jpg', (error, data) => {\n    if (error) {\n        console.log('Error', error);\n    }\n    console.log('Result: ', data);\n    \n    // data:image/gif;base64,R0lGODlhAQABAIABAEMsZgAAACwAAAAAAQABAAACAkQBAA==\n})\n``` \n\n## Cli\n\n**gm-palette** comes also with a handy Cli script:\n```bash\n$ npm i -g @davidegheri/gm-palette\n\n$ gm-palette path/to/img.jpg\n\n# [ \n#  { r: 28, g: 31, b: 38 },\n#  { r: 59, g: 61, b: 66 },\n#  { r: 62, g: 64, b: 69 },\n#  { r: 64, g: 63, b: 70 },\n#  #{ r: 65, g: 65, b: 63 },\n# ]\n```\nTo get the dominant color only:\n```bash\n$ gm-palette path/to/img.jpg --dominant\n# or\n$ gm-palette path/to/img.jpg -d\n\n# { r: 54, g: 56, b: 62 }\n```\nTo get the base64 encoded GIF:\n```bash\n$ gm-palette path/to/img.jpg --gif\n# or\n$ gm-palette path/to/img.jpg -g\n\n# data:image/gif;base64,R0lGODlhAQABAIABAEMsZgAAACwAAAAAAQABAAACAkQBAA==\n```\n","readmeFilename":"README.md"}