PHP color-extractor 정보
PHP color-extractor본문
이미지에서 색상을 추출합니다.
require 'vendor/autoload.php';
use League\ColorExtractor\Color;
use League\ColorExtractor\ColorExtractor;
use League\ColorExtractor\Palette;
$palette = Palette::fromFilename('./some/image.png');
// $palette is an iterator on colors sorted by pixel count
foreach($palette as $color => $count) {
// colors are represented by integers
echo Color::fromIntToHex($color), ': ', $count, "\n";
}
// it offers some helpers too
$topFive = $palette->getMostUsedColors(5);
$colorCount = count($palette);
$blackCount = $palette->getColorCount(Color::fromHexToInt('#000000'));
// an extractor is built from a palette
$extractor = new ColorExtractor($palette);
// it defines an extract method which return the most “representative” colors
$colors = $extractor->extract(5);
학원/학교/선생님 필수 문제풀이 솔루션 - 웹학교 데모
그누보드5 강좌 / 영카트5 강좌 / 무료 네이버 TV
By 웹학교
0
댓글 0개