Jump to content

search images by color


dlf1987

Recommended Posts

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.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.