Use the median cut algorithm to cluster similar colors.
public static getColor ( mixed $sourceImage, integer $quality = 10, array $area = null ) : array | boolean | ||
$sourceImage | mixed | Path/URL to the image, GD resource, Imagick instance, or image as binary string |
$quality | integer | 1 is the highest quality. There is a trade-off between quality and speed. The bigger the number, the faster the palette generation but the greater the likelihood that colors will be missed. |
$area | array | |
리턴 | array | boolean |