zunyunkeji / image-color
获取图片主要组成颜色并按颜色进行分组。
1.0
2019-03-29 08:29 UTC
Requires
- php: ^5.5 || ^7.0
- mischiefcollective/colorjizz: ^1.0
This package is auto-updated.
Last update: 2025-03-29 00:44:42 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 )