954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Retriev color code from image.

Hi All,

I m working on one web site and i want to search image from given color code,and i put one color piker for that but i don't know how can i get the image from that color code.

my site URL is :
http://www.alleystock.com/avd_search.php

please help me for that....!

kuldeep04
Newbie Poster
9 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 

I assume what you want to be able to do is have someone be able to select a color code, or maybe something as simple as red, blue, green, etc and then return images from your database that contain a large percentage of that color.

I have never seen this accomplished with GD, but it would be quite possible using the imagick extension or even imagemagick called from the command line.

This example comes to mind: http://valokuva.org/?p=72 It will need some modification as it currently is displaying the color palette as an image but could get you pointed in the right direction.

Once you knew the color palette you could store that information in your database and then when you ran a search it could look for anything with that color in the palette.

** This requires the imagick extension for php which is not installed or included by default. Although you should be able to do it with GD by iterating over each pixel of each image.

mschroeder
Work Harder
Team Colleague
666 posts since Jul 2008
Reputation Points: 279
Solved Threads: 131
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You