
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
node-rgbaster
Advanced tools
A simple library for extracting dominant colors from images for Node.js, which is inspired by RGBaster.
Usage is simple. Use the path of the image file, then get its dominant color & palette.
var rgbaster = require('node-rgbaster');
var imgpath = '/path/to/image.png';
rgbaster(imgpath).then(res => {
handleSuccess(res);
}).catch(err => {
handleError(err);
});
The colors function takes an object as optional second parameter, with the following options:
paletteSizeType: int Default: 10
Maximum number of palette colors to return. Only the top palette colors will be returned.
excludeType: array Default: []
RGB colors to exclude when counting colors.
For example to exclude white and black use: [ 'rgb(255,255,255)', 'rgb(0,0,0)' ]
thenType: function
Function to call after image processing has completed. The function will receive one payload argument with the following structure:
{
// {string} dominant rgb color
dominant: 'rgb(0,0,0)',
// {string} secondary rgb color
secondary: 'rgb(0,0,1)',
// {array} list of colors in the image (limited by paletteSize)
palette: [ 'rgb(0,0,1)', 'rgb(0,0,2)' ]
}
var rgbaster = require('node-rgbaster');
var imgpath = '/path/to/image.png';
rgbaster(imgpath, {
paletteSize: 2
}).then(res => {
console.log(res);
/*some of the test results
{
dominant: 'rgb(111,108,103)',
secondary: 'rgb(107,104,99)',
palette: [ 'rgb(107,104,99)', 'rgb(112,109,104)' ]
}
*/
}).catch(err => {
throw err;
});
This package is built in Promise.
MIT
FAQs
A simple library for extracting dominant colors from images.
We found that node-rgbaster demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.