i m trying to change color of a shirt. here is my code in its simplest form.
$imgname = "me.jpg";
$im = imagecreatefromjpeg ($imgname);
imagetruecolortopalette($im,false, 255);
$index = imagecolorclosest ( $im, 96, 132, 194 ); // get COlor
imagecolorset($im,$index,92,92,92); // SET NEW COLOR
$imgname = "result.jpg";
imagejpeg($im, $imgname ); // save image as gif
//imagedestroy($im);
but this code does change only specific color. You can see in attached image.
i want whole shirt color changed from blue to grey. is it possible with GD library or any other library? If yes how??