PHP Classes
elePHPant
Icontem

File: README.md

Recommend this page to a friend!
  Classes of Arnel Labarda  >  PHP Dominant Color  >  README.md  >  Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP Dominant Color
Create image with color of another dominant color
Author: By
Last change:
Date: 2 years ago
Size: 492 bytes
 

 

Contents

Class file image Download

ImageColor

Creates a data-uri based on the image dominant color.

Requirements

ImageMagick extension should be present.

Usage

require './vendor/autoload.php';

$image_url = 'https://www.elephantnaturepark.org/wp-content/uploads/2016/06/Lek_20may2016_01_n.jpg';

$i = new ImageColor\ImageColor($image_url);

echo $i->get_data_uri();

Credits

  • https://manu.ninja/dominant-colors-for-lazy-loading-images
  • https://www.webrocker.de/2016/03/28/dominant-color-in-an-image/