yarn add histogram.gl
# or
npm install histogram.gl --save
Demo: https://keller-mark.github.io/histogram.gl/
Example:
import { createRgbaHistogram, createSingleChannelHistogram } from 'histogram.gl';
createRgbaHistogram(imageData, imageWidth, imageHeight)
.then((histogramData) => {
console.log(histogramData);
});
createSingleChannelHistogram(channelData, imageWidth, imageHeight)
.then((histogramData) => {
console.log(histogramData);
});
0 dependencies.
Inspired by