Do you have a library that uses PHP or JavaScript to get the color code that is used the most in the image?

Asked 2 years ago, Updated 2 years ago, 81 views

I would like to obtain the color code (only one) that is used in the most range in the image in PHP or JavaScript.Are there any pages or libraries that might be helpful?

*I don't want to get the color of the point where I clicked the image

javascript php image

2022-09-30 19:42

1 Answers

Similar question in English, one of which is ColorExtractor (GitHub) for PHP.

Detect main colors in an image with PHP

Answer from Epoc:

use League\ColorExtractor\Palette;

$palette=Palette::fromFilename('some/image.png');

$topEightColors=$palette->getMostUsedColors(8);


2022-09-30 19:42

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.