dlf1987 Posted April 10, 2007 Share Posted April 10, 2007 Hi guys, is there any way to make a search tool that finds images by their color using a color palette? iv spent 4 hours searching google, and found nuthing php related...just coldfusion Heres an example of what I'm looking for... http://yotophoto.com/advancedsearch Thanks! Link to comment https://forums.phpfreaks.com/topic/46424-search-images-by-color/ Share on other sites More sharing options...
Asheeown Posted April 10, 2007 Share Posted April 10, 2007 Having the color stored with the rest of the info for the picture would help you achieve this. Just add another field into your database for color and allow a search by color. Link to comment https://forums.phpfreaks.com/topic/46424-search-images-by-color/#findComment-225811 Share on other sites More sharing options...
dlf1987 Posted April 10, 2007 Author Share Posted April 10, 2007 yea, iv already thought of that, but the problem is that i have over 6000 images in my database for example this site is done in php... http://www.istockphoto.com/file_search.php and i know that they don't type in every individual color that matches the images in there image database. Link to comment https://forums.phpfreaks.com/topic/46424-search-images-by-color/#findComment-225822 Share on other sites More sharing options...
Asheeown Posted April 10, 2007 Share Posted April 10, 2007 Try something along the lines of this: http://php.net/manual/en/function.imagecolorexact.php Link to comment https://forums.phpfreaks.com/topic/46424-search-images-by-color/#findComment-225835 Share on other sites More sharing options...
dlf1987 Posted April 10, 2007 Author Share Posted April 10, 2007 thanks Fearsoldier, it worked good (with gif's), but the problem is that all my product images are jpg, and imagecolorexact doesn't work with jpg's, is there a way to make it work? is there a way to convert the jpg to a gif, to be used with imagecolorexact ? Link to comment https://forums.phpfreaks.com/topic/46424-search-images-by-color/#findComment-226100 Share on other sites More sharing options...
dlf1987 Posted April 11, 2007 Author Share Posted April 11, 2007 can any1 help me with this? maybe like a link to a tutorial or sumthing? Link to comment https://forums.phpfreaks.com/topic/46424-search-images-by-color/#findComment-226774 Share on other sites More sharing options...
dlf1987 Posted April 11, 2007 Author Share Posted April 11, 2007 i got the convert from jpeg to gif work, but it loses alot of the color... any one know what im missing? if i am... $sourcePath = '../images/product-images/'.$row_rsCat['CatImage'].'/'; // Path of original image $sourceUrl = '../images/'; $sourceName = $row_Recordset1['ProItemNumber'].'-100.jpg'; // Name of original image $thumbPath = '../images/thumbs'; // Writeable thumb path $thumbUrl = $sourceUrl . '/'; $thumbName = $row_Recordset1['ProItemNumber'].'-100.gif'; // Tip: Name dynamically $thumbWidth = 100; // Intended dimension of thumb // Beyond this point is simply code. $sourceImage = imagecreatefromjpeg("$sourcePath/$sourceName"); $sourceWidth = imagesx($sourceImage); $sourceHeight = imagesy($sourceImage); $targetImage = imagecreate($thumbWidth,$thumbWidth); imagecopyresized($targetImage,$sourceImage,0,0,0,0,$thumbWidth, $thumbWidth,imagesx($sourceImage),imagesy($sourceImage)); imagegif($targetImage, "$thumbPath/$thumbName"); // By now, the thumbnail is copied into the $thumbpath // as the file name specified in $thumbName, so display echo '<img src="'.$thumbUrl.'thumbs/'.$thumbName.'" />'; thanks Link to comment https://forums.phpfreaks.com/topic/46424-search-images-by-color/#findComment-226822 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.