currently thumbnails made with my php script come out very law quality(color wise) and i want to know how to make these as colorful as the fullsize
here is my code:
PHP Code:
$thumbnail= array();
$thumbnail['small']['height'] = "80";
$thumbnail['small']['width'] = "80";
$thumbnail['medium']['height'] = "150";
$thumbnail['medium']['width'] = "150";
if($imageprop['type']=="image/gif")
{
$thumbnail['small']['fullsize']= imagecreatefromgif('/home2/animati/public_html/dev/images/news/'.$newname.'');
$thumbnail['medium']['fullsize']= imagecreatefromgif('/home2/animati/public_html/dev/images/news/'.$newname.'');
}
else if($imageprop['type']=="image/jpeg")
{
$thumbnail['small']['fullsize']= imagecreatefromjpeg('/home2/animati/public_html/dev/images/news/'.$newname.'');
$thumbnail['medium']['fullsize']= imagecreatefromjpeg('/home2/animati/public_html/dev/images/news/'.$newname.'');
}
else if($imageprop['type']=="image/png")
{
$thumbnail['small']['fullsize']= imagecreatefrompng('/home2/animati/public_html/dev/images/news/'.$newname.'');
$thumbnail['medium']['fullsize']= imagecreatefrompng('/home2/animati/public_html/dev/images/news/'.$newname.'');
}
$thumbnail['small']['canvas']= imagecreate($thumbnail['small']['width'], $thumbnail['small']['height']);
$thumbnail['medium']['canvas']= imagecreate($thumbnail['medium']['width'], $thumbnail['medium']['height']);
$thumbnail['small']['name']= "news".$articleid."_small.".$imageprop['extension']."";
$thumbnail['medium']['name']= "news".$articleid."_medium.".$imageprop['extension']."";
imagecopyresized($thumbnail['small']['canvas'], $thumbnail['small']['fullsize'], 0, 0, 0, 0, $thumbnail['small']['width'], $thumbnail['small']['height'], ImageSX($thumbnail['small']['fullsize']), ImageSY($thumbnail['small']['fullsize']));
imagecopyresized($thumbnail['medium']['canvas'], $thumbnail['medium']['fullsize'], 0, 0, 0, 0, $thumbnail['medium']['width'], $thumbnail['medium']['height'], ImageSX($thumbnail['medium']['fullsize']), ImageSY($thumbnail['medium']['fullsize']));
if($imageprop['type']=="image/gif")
{
imagegif($thumbnail['small']['canvas'], '/home2/animati/public_html/dev/images/news/'.$thumbnail[small][name].'');
imagegif($thumbnail['medium']['canvas'], '/home2/animati/public_html/dev/images/news/'.$thumbnail[medium][name].'');
}
else if($imageprop['type']=="image/jpeg")
{
imagejpeg($thumbnail['small']['canvas'], '/home2/animati/public_html/dev/images/news/'.$thumbnail[small][name].'');
imagejpeg($thumbnail['medium']['canvas'], '/home2/animati/public_html/dev/images/news/'.$thumbnail[medium][name].'');
}
else if($imageprop['type']=="image/png")
{
imagepng($thumbnail['small']['canvas'], '/home2/animati/public_html/dev/images/news/'.$thumbnail[small][name].'');
imagepng($thumbnail['medium']['canvas'], '/home2/animati/public_html/dev/images/news/'.$thumbnail[medium][name].'');
}