I am trying to get dominant colors from image with percentage or with count of each color. I tried this method from imagick php library.
$imagick->quantizeImage(256, \Imagick::COLORSPACE_YIQ, 0, false, false);
$imagick->uniqueImageColors();
$imagick->scaleimage($imagick->getImageWidth(), $imagick->getImageHeight() * 20);
header("Content-Type: image/png");
echo $imagick->getImageBlob();
It is returning the image blob but i want color value in hex or rgba with count/perncentage.