GLOB
Montagne, Informatique & Pensées...

Just a piece of code

publié le 13/03/2014

Going down the path that leads to more useless stats for my friend's-and-personal photo server software, I wanted to extract the most prominent color of an image. Googling, I finally found Pieroxy Color Finder and decided to port the script for PHP.

It is now available on github. If you have any question or feed backs, you can contact me from there.

Have fun and remember there are never enough useless stats !

It is very Simple to use, just include the ColorExtract.php then, there are two ways to do it, you can either call :

$extractor = ColorExtractor::createFromURL([class of color extractor], [filename]);

Or create a color extractor directly from an existing GD image :
$extractor = new HueColorExtractor([gd image], [image size]);
Then call :
$color = $colorExtractor->extract();
There is a very simple example but that should be enough
PHP colors

Pourquoi un blog ?

Il me fallait bien entrer dans la modernité, après tout, un développeur sans blog, c'est comme un trailer sans pipette ça fait pas sérieux.

Je ne suis pas sûr que ce blog fera sérieux mais, si lecteur il y a, ce sera à eux d'en décider.


Powered by Jalmot