image-color-detector
v1.0.7
Published
Detect colors from any image
Downloads
7
Readme
image-color-detector
Detect colors from any image
Installation
npm install image-color-detector
Basic usage
The component has only following required props: Image , Count , PixelPercentage , Quality , Delta
Usage
import colorThief from 'image-color-detector';
const colorPalette = colorThief.getPalette(img, count,Quality,pixelPercentage,delta);
Props
img (required): The image to detects the colors from.
count (optional): Number of Color counts we needed from the image
Quality (optional): Defines the accuracy of the color detection(1-default).The bigger the number, the faster a color will be returned but the greater the likelihood that it will not be the visually most dominant color
pixelPercentage (optional):The pixelPercentage is used as a threshold to filter out certain colors based on the Alpha value.
delta (optional): Delta is a threshold value used to determine whether two colors in the colorArray are considered similar
Examples
//detect the colors from the image provided
const colorPalette = colorThief.getPalette("./getColor.png", 10,1,0.008,30);
Note
Color Detection will have the different shades of the colors as per the number of count, pixelPercentage and delta