PHP Classes
elePHPant
Icontem

Color extract: Extracts the most common colors used in images

Recommend this page to a friend!

  Author Author  
Picture of Csongor Zalatnai
Name: Csongor Zalatnai <contact>
Classes: 1 package by
Country: Hungary Hungary
Innovation award
Innovation award
Nominee: 1x


  Detailed description   Download Download .zip .tar.gz   Install with Composer Install with Composer  
This class can be used to extract the most common colors used in images.

It can open an image file in the GIF, JPEG or PNG format. Then it traverses the image and returns an array with the most used color tones.

  Classes of Csongor Zalatnai  >  Color extract  >  Download Download .zip .tar.gz  >  Support forum Support forum (5)  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: Color extract
Base name: colorextract
Description: Extracts the most common colors used in images
Version: 1.0.0
PHP version: -
License: BSD License
 
  Groups   Trackback   Applications   Related pages   Files Files  

  Groups  
Group folder image Graphics Colors, images, charts and picture formats View top rated classes


  Innovation Award  
PHP Programming Innovation award nominee
September 2006
Number 10
An image may be made of dots of many colors. Finding which colors are most frequently used in an image, is relatively easy. It is a matter of building an histogram.

However, if you want to find which are the dominant tones, that is much harder, as the most frequently used colors may not be exactly the dominant tones.

This class provides a solution for finding the topmost dominant tones used in an image, using only PHP code without any special PHP extensions, except for the GD library functions.

That may be useful to use background colors on a page that match the dominant tones used in images presented in that page.

Manuel Lemos

  Pages that reference this package  
Color for Developers
Color is important for developers as well as designers, below you’ll find a collection of tools and libraries that make it easier for you work with color in your code...
Extracting Web Colors from Photographs
Have you ever come across a website where the colors of the page are based on the photograph being displayed?...
happy 2008
The 408 photos posted in 2007. And these are the colours most used in the photos posted in 2007. (thanks to a PHP script by Csongor Zalatnai)...
Links for 2007-10-09
can open an image file in the GIF, JPEG or PNG format. Then it traverses the image and returns an array with the most used color tones...
Projects: Color to Name
Ok, so I was coding some stuff for naranai and I was thinking to myself that it’d be cool if I could automatically detect a few dominant colors in a picture and use it to make them searchable...

Latest pages that reference packages Latest pages that reference packages


  Applications that use this package  
http://www.pixelfoto.hu
Pixelfoto stock photography

Add link image If you know an application of this package, send a message to the author to add a link here.


  Related pages  
http://www.pixelfoto.hu/color/
You can test the class here

  Files folder image Files  
File Role Description
Plain text file colors.inc.php Class The main class
Accessible without login Plain text file example.php Example Example script
Accessible without login Image file test.jpg Photo Test image no. 1
Accessible without login Image file test2.jpg Photo Test image no. 2

Install with Composer Install with Composer - Download Download all files: colorextract.tar.gz colorextract.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.