Link to home
Start Free TrialLog in
Avatar of nandananushil1
nandananushil1Flag for India

asked on

php image search

i want to be able to search images using their colors something like google image search. i am able to extract collor palletes from images but how exactly do i match colors?

do i need to make array of colors with all values ? if i do so won't that be a very long array?
Avatar of haijerome
haijerome
Flag of India image

Hi nandananushil1,

 Glad to help you ... this is the one you need exactly...

go through with the link below

http://tyler.tc/cpallete/upload.php

but the below links are the recommended ones...

http://www.devshed.com/c/a/PHP/Implementing-Yahoo-Image-Search-Web-Service-with-PHP-5/


http://developer.yahoo.net/blog/archives/2009/03/image-search-hack-with-yql-and-yui.html


http://w-shadow.com/.../get-google-image-search-results-with-php/


 I hope your problem is solved  after go through with these links and web services....

 If it helps then its cool else let me know...


Regards,
Jerome Dennis D
Avatar of nandananushil1

ASKER

Hi haijerome

Thankyou so much for reply. These links are great, but i wanted to search within my database. I have a php class which extracts color from image, i am storing top 10 colors in database, something like this :

pid   hex
1      ffffff
1     d80101
1     002cfc

now if i search for red, which is ff0000, none will match as but d80101 is almost red and i want it to display it in result. any idea how can i achieve that

thanks
nandan
Hi nandananushil1,

      i thought that you need to generate color pallette from an uploaded image so that i have provided you with those links ...

     what do you need now is if the user searches for  #990000 then eventhough there is no value #990000 in database you need to match it with #ff0000 (the next close color to it) if it in databse .. Is it right ?

    If so then its all our logic ....  There are only three primary colors RGB .....

      from these multiple colors are forming only using these colors (I know that you know all these well)...   To coin your logic i went thru this link below it gave me some idea just watch {1,2,3},{4,5,6}.{7,8,9} all these are very close ones irrespective of what the value that you've changed !!! you try to figure out some sort of relations between them ....

     http://www.hypergurl.com/colormatch.php

I hope it helps else let me know...

Regards,
Jerome Dennis D
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aburr
When checking for a match , allow for a near miss. You may have to use if statements.
Ie if you are looking for a match to 142 as in if 142 (if a hit, go to next match. if not, try 143) if hit go to nest match, if not try 141 etc