zunyunkeji/image-color

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

获取图片主要组成颜色并按颜色进行分组。

1.0 2019-03-29 08:29 UTC

This package is auto-updated.

Last update: 2021-06-29 01:32:48 UTC


README

获取图片看主要颜色,以方便根据颜色对图片进行分类排序 更多源码可访问 http://www.wdphp.com

Composer

composer require zunyunkeji/image-color

使用示例

Script

<?php
use zunyunkeji\imageColor\Image;

$img = new Image();
$img->load(__DIR__ . '/logo.jpg');
$info = $img->primaryColors();

print_r($info);
?>

返回数据

Array
(
    [red] => 66316
    [white] => 10526
    [light-pink] => 373
    [light-red] => 325
    [light-gray] => 245
    [tan] => 30
    [dark-orange] => 26
    [pink] => 1
)