Login   Register  
PHP Classes
elePHPant
Icontem

Color extract: Extracts the most common colors used in images

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

  Author Author  
Picture of Csongor Zalatnai
Name: Csongor Zalatnai <e-mail contact>
Packages: 1 Browse all classes by Csongor Zalatnai Browse all classes by
Country: Hungary Hungary - PHP jobs in Hungary
Age: 24
All time rank: 7107 in Hungary Hungary
Week rank: 174 Up6 in Hungary Hungary Up
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
All time users: 3880 users
All time rank: 732
Week users: 12 users
Week rank: 101 Up
 
  Groups   Rate classes User ratings   Trackback  
  Applications   Related links   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

  User ratings  
RatingsUtility Consistency Documentation Examples Tests Videos Overall Rank
All time: Perfect (100.0%) Perfect (100.0%) - Good (90.0%) - - Sufficient (69.0%) 256
Month: Not yet rated by the users

  Trackback links  
Link Description
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...

  Applications that use this class  
Link Description
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 links  
Link Description
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.