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....!

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.