Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aqlx86/image-color
Creates a data-uri based on the image dominant color.
https://github.com/aqlx86/image-color
Last synced: about 1 month ago
JSON representation
Creates a data-uri based on the image dominant color.
- Host: GitHub
- URL: https://github.com/aqlx86/image-color
- Owner: aqlx86
- Created: 2016-12-10T18:42:47.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-10T18:58:22.000Z (about 8 years ago)
- Last Synced: 2024-05-01T13:23:59.094Z (9 months ago)
- Language: PHP
- Size: 1.95 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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/