Skip to content

Latest commit

 

History

History
55 lines (47 loc) · 1.27 KB

README.md

File metadata and controls

55 lines (47 loc) · 1.27 KB

ColorExtractor

Extract colors from an image like a human would do.

Usage

Include ColorExtractor class as you want and call its extract method:

<?php

include 'path/to/ColorExtractor.php'

$palette = ColorExtractor::extract(/* … */);

Parameters

parameter description default value
imageResource image resource identifier, as returned by imagecreatefromjpeg -
maxPaletteSize maximum size of the colors array returned by ColorExtractor::extract 1
minColorRatio minimum ratio below colors are ignored (0 - 1) 0
minSaturation minimum saturation level below colors are ignored (0 - 1) 0

Return

Returns an array with hexadecimal codes of dominant colors.