Skip to content

scratcher28/ColorExtractor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Extract colors from an image like a human would do.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%