2017 © Pedro Peláez
 

library palette

Get most used colors from an image

image

ivuorinen/palette

Get most used colors from an image

  • Thursday, September 14, 2017
  • by ivuorinen
  • Repository
  • 1 Watchers
  • 3 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Palette Build Status

Palette is a PHP class that takes your images and returns used colors, sorts them by usage and saves the results., (*1)

Usage

After adding Palette to your composer.json file and installed to your vendor folder, you can use the class like this:, (*2)

With default settings

$image = "example/example.jpg";
$palette = new \ivuorinen\Palette\Palette($image);
print_r($palette->colorsArray);

With custom settings

$palette = new \ivuorinen\Palette\Palette();

$palette->filename     = "example/example.jpg"; // Our image
$palette->precision    = 10; // Precision of color collection
$palette->returnColors = 10; // How many colors we want
$palette->destination  = './data/' . md5($palette->filename) . '.json';

// Do the work (same as ``Palette::run()``)
$this->getPalette();
$this->save(); // Not needed, but caching results <3

// We now have ``./data/7233c3b944f5299c6983c77c94e75dce.json`` (if everything went smoothly)
// and we can test against it before running palette generation. Which you should do really.

print_r($palette->colorsArray);

The Versions

14/09 2017

dev-master

9999999-dev https://github.com/ivuorinen/palette

Get most used colors from an image

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

colors image palette psr-2

01/07 2013

1.0.1

1.0.1.0 https://github.com/ivuorinen/palette

Get most used colors from an image

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

colors image palette psr-2

27/06 2013

1.0.0

1.0.0.0 https://github.com/ivuorinen/palette

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

colors image palette psr-2