A simple library that calculates the average color of any images for Node.js.
Supported formats:
Source
- filename
- url
- Buffer
- base64 string
Install
npm i --save fast-average-color-node
Using
import { getAverageColor } from 'fast-average-color-node';
getAverageColor('./image.png').then(color => {
console.log(color);
});
or
import { getAverageColor } from 'fast-average-color-node';
async function printAverageColor() {
const color = await getAverageColor('./image.png');
console.log(color);
};
printAverageColor();
API
getAverageColor(filename, options)
Parameters
Return value
The promise with value.
MIT License
Links